Daniel Holth avatar Daniel Holth committed 8e221b8

Fix pypy support by replacing "if 'unicode' in __builtins__"

Comments (0)

Files changed (4)

+1.4.1
+=====
+- Fix pypy support by replacing "if 'unicode' in __builtins__"
+
 1.4
 ===
 - Tests all run under Python 3 (skipping doctest)

cryptacular/core/__init__.py

 ]
 
 
-if 'unicode' in __builtins__: # pragma NO COVERAGE
+try:
+    unicode
     def check_unicode(text):
         if isinstance(text, unicode):
             text = text.encode('utf-8')
         if not isinstance(text, str):
             raise TypeError()
         return text
-else: # pragma NO COVERAGE
+except NameError:
     def check_unicode(text):
         # In Python3, PyArg_ParseTuple("ss") in the builtin crypt module
         # and our _bcrypt.c encodes unicode as utf-8, which falls short
 tests_require = ["nose", "coverage"]
 
 setup(name='cryptacular',
-      version='1.4',
+      version='1.4.1',
       description='A password hashing framework with bcrypt and pbkdf2.',
       long_description=README + '\n\n' +  CHANGES,
       classifiers=[
 [tox]
-envlist=py27,py32
+envlist=py27,py32,pypy
 [testenv]
 deps=nose
 	coverage
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.