diff --git a/Lib/UserDict.py b/Lib/UserDict.py index 6b5c9dade6..35f86fc4dc 100644 --- a/Lib/UserDict.py +++ b/Lib/UserDict.py @@ -155,6 +155,8 @@ class DictMixin: 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)