Commits

jayd3e committed 877c022

Fixed some UserDict instances, that cannot be fixed through Twelve. Also correct the user of the except command.w

Comments (0)

Files changed (3)

webob/byterange.py

 import six
+import sys
 
 class Range(object):
     """
                         end = None
                     last_end = end
                 ranges.append((begin, end))
-        except ValueError, e:
+        except ValueError:
             # In this case where the Range header is malformed,
             # section 14.16 says to treat the request as if the
             # Range header was not present.  How do I log this?
+            e = sys.exc_info()[1]
             return None
         return (units, ranges)
 
 import six
 from webob.multidict import MultiDict
-from UserDict import DictMixin
+
+if six.PY3:
+    from collections import MutableMapping as DictMixin
+else:
+    from UserDict import DictMixin
 
 __all__ = ['ResponseHeaders', 'EnvironHeaders']
 

webob/multidict.py

 import sys
 import warnings
 import urllib
-from UserDict import DictMixin
+
+if six.PY3:
+    from collections import MutableMapping as DictMixin
+else:
+    from UserDict import DictMixin
 
 
 __all__ = ['MultiDict', 'UnicodeMultiDict', 'NestedMultiDict', 'NoVars',