summaryrefslogtreecommitdiff
path: root/gear/__init__.py
diff options
context:
space:
mode:
authorClint Byrum <clint@fewbar.com>2015-02-22 14:34:57 -0800
committerClint Byrum <clint@fewbar.com>2015-03-11 17:37:49 -0700
commit0b6bf90f3dbbfb807790db1408e83ba5a58e792a (patch)
treeca7bef8e45b395a1be08979c8c4dc4a43c4f2494 /gear/__init__.py
parentac526750617b09d3ca4a34f3d78fabd05ab3876a (diff)
downloadgear-0b6bf90f3dbbfb807790db1408e83ba5a58e792a.tar.gz
Resolve python3 test failures
Under python3.4, "" or 'misc' is not a bytearray anymore. Tests for this type would fail in python3.4, even though the arguments are explicitly called out as "bytes". Several test failures in python3.4 are related to byte strings returning ints and default strings no longer counting as byte strings. In python3, sort does not take a cmp function but a key function. Also dict.items() returns a dict_items object which cannot be sorted, but can be converted into a list(). Also in python3 the crypto.dump_ methods return bytes instead of strings. Change-Id: I36fde6475f6cc517c1a9c3c135c28d3ea61e6a4a
Diffstat (limited to 'gear/__init__.py')
-rw-r--r--gear/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gear/__init__.py b/gear/__init__.py
index 0345a35..2069f92 100644
--- a/gear/__init__.py
+++ b/gear/__init__.py
@@ -307,7 +307,7 @@ class Connection(object):
self._putAdminRequest(admin_request)
raise
if admin is None:
- if raw_bytes[0] == b'\x00':
+ if raw_bytes[0:1] == b'\x00':
admin = False
else:
admin = True
@@ -1607,8 +1607,8 @@ class Client(BaseClient):
"""
job = packet.getJob()
- job.known = (packet.getArgument(1) == '1')
- job.running = (packet.getArgument(2) == '1')
+ job.known = (packet.getArgument(1) == b'1')
+ job.running = (packet.getArgument(2) == b'1')
job.numerator = packet.getArgument(3)
job.denominator = packet.getArgument(4)