Skip to content

Commit

Permalink
Merge pull request AlessandroZ#404 from cclauss/patch-1
Browse files Browse the repository at this point in the history
Travis CI: Let's pass the lint tests on Python 3 again
  • Loading branch information
AlessandroZ authored Jun 18, 2019
2 parents 7f4040a + fa5db02 commit 63a78e9
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ lint_steps: &lint_steps
before_install:
- pip install --upgrade pip
- pip install flake8
script: flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics --builtins="unicode"
script: flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics

matrix:
allow_failures:
- python: '3.7'
include:
- name: "Test and deploy on Python 2.7"
python: '2.7'
Expand Down
3 changes: 1 addition & 2 deletions Linux/lazagne/config/crypto/pyDes.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ def __init__(self, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
self._iv = IV
self._padding = pad
self._padmode = padmode

def getKey(self):
"""getKey() -> bytes"""
return self.__key
Expand Down Expand Up @@ -231,7 +230,7 @@ def _guardAgainstUnicode(self, data):
# Only accept byte strings or ascii unicode values, otherwise
# there is no way to correctly decode the data into bytes.
if _pythonMajorVersion < 3:
if isinstance(data, unicode):
if isinstance(data, unicode): # noqa
raise ValueError("pyDes can only work with bytes, not Unicode strings.")
else:
if isinstance(data, str):
Expand Down
2 changes: 1 addition & 1 deletion Linux/lazagne/config/crypto/pyaes/aes.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _concat_list(a, b):
# Python 3 compatibility
try:
xrange
except Exception:
except NameError:
xrange = range

# Python 3 supports bytes, which is already an array of integers
Expand Down
2 changes: 1 addition & 1 deletion Linux/lazagne/config/crypto/pyaes/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def _get_byte(c):

try:
xrange
except:
except NameError:

def to_bufferable(binary):
if isinstance(binary, bytes):
Expand Down
2 changes: 1 addition & 1 deletion Mac/lazagne/config/crypto/pyDes.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def _guardAgainstUnicode(self, data):
# Only accept byte strings or ascii unicode values, otherwise
# there is no way to correctly decode the data into bytes.
if _pythonMajorVersion < 3:
if isinstance(data, unicode):
if isinstance(data, unicode): # noqa
raise ValueError("pyDes can only work with bytes, not Unicode strings.")
else:
if isinstance(data, str):
Expand Down
4 changes: 2 additions & 2 deletions Windows/lazagne/config/crypto/pyDes.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _guardAgainstUnicode(self, data):
# Only accept byte strings or ascii unicode values, otherwise
# there is no way to correctly decode the data into bytes.
if _pythonMajorVersion < 3:
if isinstance(data, unicode):
if isinstance(data, unicode): # noqa
raise ValueError("pyDes can only work with bytes, not Unicode strings.")
else:
if isinstance(data, str):
Expand Down Expand Up @@ -849,4 +849,4 @@ def decrypt(self, data, pad=None, padmode=None):
data = self.__key3.crypt(data, DECRYPT)
data = self.__key2.crypt(data, ENCRYPT)
data = self.__key1.crypt(data, DECRYPT)
return self._unpadData(data, pad, padmode)
return self._unpadData(data, pad, padmode)

0 comments on commit 63a78e9

Please sign in to comment.