[Python-modules-commits] [python-zxcvbn] 01/02: upstream fix for new version: 4.4.15

Sabino Par sprab-guest at moszumanska.debian.org
Thu Jul 20 20:02:09 UTC 2017


This is an automated email from the git hooks/post-receive script.

sprab-guest pushed a commit to branch upstream
in repository python-zxcvbn.

commit afedfa5d8a70b147ad21122d5884801c4a0d8e5b
Author: sprab-guest <sprab at onenetbeyond.org>
Date:   Wed Jul 19 22:12:10 2017 +0200

    upstream fix for new version: 4.4.15
---
 setup.py           |  4 ++--
 zxcvbn/__init__.py | 14 +++++++++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/setup.py b/setup.py
index 5550a37..aa814e7 100644
--- a/setup.py
+++ b/setup.py
@@ -2,10 +2,10 @@ from distutils.core import setup
 
 setup(
     name='zxcvbn-python',
-    version='4.4.14',
+    version='4.4.15',
     packages=['zxcvbn'],
     url='https://github.com/dwolfhub/zxcvbn-python',
-    download_url='https://github.com/dwolfhub/zxcvbn-python/tarball/v4.4.14',
+    download_url='https://github.com/dwolfhub/zxcvbn-python/tarball/v4.4.15',
     license='MIT',
     author='Daniel Wolf',
     author_email='danielrwolf5 at gmail.com',
diff --git a/zxcvbn/__init__.py b/zxcvbn/__init__.py
index 11964eb..02aa347 100644
--- a/zxcvbn/__init__.py
+++ b/zxcvbn/__init__.py
@@ -4,12 +4,24 @@ from . import matching, scoring, time_estimates, feedback
 
 
 def zxcvbn(password, user_inputs=None):
+    try:
+        # Python 2 string types
+        basestring = (str, unicode)
+    except NameError:
+        # Python 3 string types
+        basestring = (str, bytes)
+
     if user_inputs is None:
         user_inputs = []
 
     start = datetime.now()
 
-    sanitized_inputs = [str(arg).lower() for arg in user_inputs]
+    sanitized_inputs = []
+    for arg in user_inputs:
+        if not isinstance(arg, basestring):
+            arg = str(arg)
+        sanitized_inputs.append(arg.lower())
+
     matching.set_user_input_dictionary(sanitized_inputs)
 
     matches = matching.omnimatch(password)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-zxcvbn.git



More information about the Python-modules-commits mailing list