Commit 8d2d4c7f authored by Jérome Perrin's avatar Jérome Perrin

fixup! fix SyntaxWarning

parent 9b77144e
...@@ -1014,10 +1014,10 @@ class Base( ...@@ -1014,10 +1014,10 @@ class Base(
result = None result = None
else: else:
if isinstance(value, (list, tuple)): if isinstance(value, (list, tuple)):
if len(value) is 0: if len(value):
result = None
else:
result = value[0] result = value[0]
else:
result = None
else: else:
result = value result = value
else: else:
...@@ -1048,10 +1048,10 @@ class Base( ...@@ -1048,10 +1048,10 @@ class Base(
result = None result = None
else: else:
if isinstance(value, (list, tuple)): if isinstance(value, (list, tuple)):
if len(value) is 0: if len(value):
result = None
else:
result = value[0] result = value[0]
else:
result = None
else: else:
result = value result = value
else: else:
...@@ -1092,10 +1092,10 @@ class Base( ...@@ -1092,10 +1092,10 @@ class Base(
result = None result = None
else: else:
if isinstance(value, (list, tuple)): if isinstance(value, (list, tuple)):
if len(value) is 0: if len(value):
result = None
else:
result = value[0] result = value[0]
else:
result = None
else: else:
result = value result = value
else: else:
......
...@@ -900,7 +900,7 @@ def save_bytes(self, tag, data): ...@@ -900,7 +900,7 @@ def save_bytes(self, tag, data):
v = b''.join(data[2:]) v = b''.join(data[2:])
encoding = a.get('encoding', 'repr') encoding = a.get('encoding', 'repr')
assert encoding == 'base64' assert encoding == 'base64'
if encoding is not '': if encoding != '':
v = unconvert(encoding, v) v = unconvert(encoding, v)
if self.binary: if self.binary:
l = len(v) l = len(v)
...@@ -924,7 +924,7 @@ def save_unicode(self, tag, data): ...@@ -924,7 +924,7 @@ def save_unicode(self, tag, data):
for x in data[2:]: for x in data[2:]:
v=v+x v=v+x
encoding=a.get('encoding','repr') # JPS: repr is default encoding encoding=a.get('encoding','repr') # JPS: repr is default encoding
if encoding is not '': if encoding != '':
v=unconvert(encoding,v) v=unconvert(encoding,v)
if binary: if binary:
l=len(v) l=len(v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment