diff --git a/Lib/UserDict.py b/Lib/UserDict.py index 6b5c9dade6a..35f86fc4dc1 100644 --- a/Lib/UserDict.py +++ b/Lib/UserDict.py @@ -155,6 +155,8 @@ def get(self, key, default=None): def __repr__(self): return repr(dict(self.iteritems())) def __cmp__(self, other): + if other is None: + return 1 if isinstance(other, DictMixin): other = dict(other.iteritems()) return cmp(dict(self.iteritems()), other)