summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-11-02 20:28:58 +0200
committerLars Wirzenius <liw@liw.fi>2015-11-02 20:28:58 +0200
commit7a7df43d3c56ab5205f4345b2e54a8ae2586fe2b (patch)
tree2a683f025b8e8d8c774d446fb17fc0e257ec9f0c
parentea3b43aa7d7e37ecff31bb5b9114affc10d9b311 (diff)
downloadobnam-7a7df43d3c56ab5205f4345b2e54a8ae2586fe2b.tar.gz
Revert "Change type checking in object serialisation"
This reverts commit c69795b71aaba8bf0408b357fdec187c0202a1a8. The fix in that commit, to use isintance(foo,int) instead of type(foo)==int, is wrong. Pylint be damned.
-rw-r--r--obnamlib/obj_serialiser.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/obnamlib/obj_serialiser.py b/obnamlib/obj_serialiser.py
index 953bd3a8..b39505d9 100644
--- a/obnamlib/obj_serialiser.py
+++ b/obnamlib/obj_serialiser.py
@@ -147,9 +147,8 @@ def _next_object(pos, length):
def _serialise_dict(obj):
keys = obj.keys()
- int_keys = [key for key in keys
- if isinstance(obj[key], int) or isinstance(obj[key], long)]
- str_keys = [key for key in keys if isinstance(obj[key], str)]
+ int_keys = [key for key in keys if type(obj[key]) in (int, long)]
+ str_keys = [key for key in keys if type(obj[key]) is str]
special_keys = set(int_keys).union(set(str_keys))
other_keys = [key for key in keys if key not in special_keys]