From 0f4940c0a8d2ac66ccf90fb12739967915043406 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 1 Jun 2002 00:57:55 +0000 Subject: Replaced boolean test with 'is None' --- Lib/ConfigParser.py | 2 +- Lib/dis.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/ConfigParser.py b/Lib/ConfigParser.py index e52f620..f457e72 100644 --- a/Lib/ConfigParser.py +++ b/Lib/ConfigParser.py @@ -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: diff --git a/Lib/dis.py b/Lib/dis.py index 39bfb7d..8ea6d98 100644 --- a/Lib/dis.py +++ b/Lib/dis.py @@ -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 = "" -- cgit v0.12