Преглед на файлове

Try to fix python3 compatibility ...

Work in progress ...
oz123 преди 10 години
родител
ревизия
8c1357abab
променени са 2 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 2 1
      pwman/tests/test_tools.py
  2. 2 0
      pwman/util/crypto.py

+ 2 - 1
pwman/tests/test_tools.py

@@ -37,7 +37,8 @@ class DummyCallback3(Callback):
         return u'newsecret'
 
     def getsecret(self, question):
-        return u'12345'
+        ans = '12345'
+        return ans
 
     def getnewsecret(self, question):
         return u'newsecret'

+ 2 - 0
pwman/util/crypto.py

@@ -426,6 +426,8 @@ class CryptoEngine(object):
         """
         retrieve encrypted data
         """
+        if sys.version_info.major > 2:
+            return plaintext
         try:
             plaintext.decode('utf-8')
         except UnicodeDecodeError: