Another Py3 change, this one for functools32

This commit is contained in:
Lance 2013-10-30 12:06:41 -04:00
parent de41143159
commit 74cfb69f5a
2 changed files with 11 additions and 2 deletions

View File

@ -92,6 +92,10 @@ class CustomDevelopCommand(develop):
self.run_command('download_db')
requirements = ['ftfy >= 3']
if sys.version_info.major == 2:
requirements.append('functools32 == 3.2.3-1')
setup(
name="wordfreq",
version=config.VERSION,
@ -104,7 +108,7 @@ setup(
classifiers = classifiers,
long_description = "\n".join(doclines[2:]),
packages=['wordfreq'],
install_requires=['ftfy >= 3', 'functools32 == 3.2.3-1'],
install_requires=requirements,
cmdclass = {
'build_db': BuildDatabaseCommand,
'download_db': DownloadDatabaseCommand,

View File

@ -1,6 +1,11 @@
from wordfreq.config import DB_FILENAME, CACHE_SIZE
from functools32 import lru_cache
import sqlite3
import sys
if sys.version_info.major == 2:
from functools32 import lru_cache
else:
from functools import lru_cache
SQLITE_ERROR_TEXT = """
Couldn't open the wordlist database.