mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Replaced boolean tests with is None.
This commit is contained in:
parent
f13eb55d59
commit
10ff706e27
5 changed files with 14 additions and 14 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue