Skip to content

Commit

Permalink
Fix OrderedDict test
Browse files Browse the repository at this point in the history
Existing code would have raised:
AttributeError: 'module' object has no attribute 'OrderedDict'

Instead import the class directly into the current namespace to force an
ImportError exception
  • Loading branch information
selsky committed Jan 11, 2017
1 parent 69e3b67 commit 36a8c26
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pylib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,7 @@ def summary(self, i, variables):
return s

try:
import collections
OrderedDict = collections.OrderedDict
from collections import OrderedDict
except ImportError:
class OrderedDict(dict):
"A stupid simple implementation in order to be back-portable to 2.6"
Expand Down

0 comments on commit 36a8c26

Please sign in to comment.