Skip to content
Myr

Since requests 0.10.1 dropped Python5 support, to catch an exception and

Before adoption: this commit came in with the history the project adopted, so no landing records it.

store the exception object in a variable the "as" keyword can be used so Python3 will not raise a SyntaxError

authored by Daniele Tricoli · committed by Daniele Tricoli · parent a74481a · Browse files · 1 file+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:requests/packages/oreos/structures.py+3 added-3 removed
360 unmodified lines
361 not in the dictionary.362 """363 try:364 return dict.pop(self, key)[0]365 except KeyError, e:365 except KeyError as e:366 if default is not _missing:367 return default368 raise KeyError(str(e))369
1 unmodified line
371 """Pop an item from the dict."""372 try:373 item = dict.popitem(self)374 return (item[0], item[1][0])375 except KeyError, e:375 except KeyError as e:376 raise KeyError(str(e))377378 def poplist(self, key):379 """Pop the list for a key from the dict. If the key is not in the dict
8 unmodified lines
388 def popitemlist(self):389 """Pop a ``(key, list)`` tuple from the dict."""390 try:391 return dict.popitem(self)392 except KeyError, e:392 except KeyError as e:393 raise KeyError(str(e))394395 def __copy__(self):396 return self.copy()
3 unmodified lines