[pypy-commit] pypy py3.6: test for str
mattip
pypy.commits at gmail.com
Wed Jun 5 00:38:56 EDT 2019
Author: Matti Picus <matti.picus at gmail.com>
Branch: py3.6
Changeset: r96742:36dc395a0a4a
Date: 2019-06-05 07:38 +0300
http://bitbucket.org/pypy/pypy/changeset/36dc395a0a4a/
Log: test for str
diff --git a/lib_pypy/_crypt/__init__.py b/lib_pypy/_crypt/__init__.py
--- a/lib_pypy/_crypt/__init__.py
+++ b/lib_pypy/_crypt/__init__.py
@@ -15,6 +15,10 @@
def crypt(word, salt):
+ if isinstance(word, str):
+ word = word.encode('ascii')
+ if isinstance(salt, str):
+ salt = salt.encode('ascii')
res = lib.crypt(word, salt)
if not res:
return None
More information about the pypy-commit
mailing list