]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Replaced boolean test with 'is None'
authorRaymond Hettinger <python@rcn.com>
Sat, 1 Jun 2002 00:57:55 +0000 (00:57 +0000)
committerRaymond Hettinger <python@rcn.com>
Sat, 1 Jun 2002 00:57:55 +0000 (00:57 +0000)
Lib/ConfigParser.py
Lib/dis.py

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