Replaced boolean tests with is None.

This commit is contained in:
Raymond Hettinger 2002-06-02 03:04:52 +00:00
parent f13eb55d59
commit 10ff706e27
5 changed files with 14 additions and 14 deletions

View file

@ -755,7 +755,7 @@ def dumps(params, methodname=None, methodresponse=None, encoding=None):
elif methodresponse and isinstance(params, TupleType):
assert len(params) == 1, "response tuple must be a singleton"
if not encoding:
if encoding is None:
encoding = "utf-8"
m = Marshaller(encoding)
@ -767,7 +767,7 @@ def dumps(params, methodname=None, methodresponse=None, encoding=None):
xmlheader = "<?xml version='1.0'?>\n" # utf-8 is default
# standard XML-RPC wrappings
if methodname:
if methodname is not None:
# a method call
if not isinstance(methodname, StringType):
methodname = methodname.encode(encoding)