Commit 1b237fd3 authored by Raymond Hettinger's avatar Raymond Hettinger

Replaced boolean test with 'is None'

parent 0c9341db
...@@ -270,7 +270,7 @@ class ConfigParser: ...@@ -270,7 +270,7 @@ class ConfigParser:
d = self.__defaults.copy() d = self.__defaults.copy()
d.update(sectdict) d.update(sectdict)
# Update with the entry specific variables # Update with the entry specific variables
if vars: if vars is not None:
d.update(vars) d.update(vars)
option = self.optionxform(option) option = self.optionxform(option)
try: try:
......
...@@ -13,7 +13,7 @@ def dis(x=None): ...@@ -13,7 +13,7 @@ def dis(x=None):
With no argument, disassemble the last traceback. With no argument, disassemble the last traceback.
""" """
if not x: if x is None:
distb() distb()
return return
if type(x) is types.InstanceType: if type(x) is types.InstanceType:
...@@ -44,7 +44,7 @@ def dis(x=None): ...@@ -44,7 +44,7 @@ def dis(x=None):
def distb(tb=None): def distb(tb=None):
"""Disassemble a traceback (default: last traceback).""" """Disassemble a traceback (default: last traceback)."""
if not tb: if tb is None:
try: try:
tb = sys.last_traceback tb = sys.last_traceback
except AttributeError: except AttributeError:
...@@ -312,12 +312,12 @@ def _test(): ...@@ -312,12 +312,12 @@ def _test():
fn = None fn = None
else: else:
fn = None fn = None
if not fn: if fn is None:
f = sys.stdin f = sys.stdin
else: else:
f = open(fn) f = open(fn)
source = f.read() source = f.read()
if fn: if fn is not None:
f.close() f.close()
else: else:
fn = "<stdin>" fn = "<stdin>"
......
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