File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 17
17
import zlib
18
18
19
19
20
- import sys
21
-
22
20
class ObjectDict (dict ):
23
21
"""Makes a dictionary behave like an object, with attribute-style access.
24
22
"""
@@ -75,10 +73,6 @@ def import_object(name):
75
73
True
76
74
>>> import_object('tornado') is tornado
77
75
True
78
- >>> import_object('missing_module')
79
- Traceback (most recent call last):
80
- ...
81
- ImportError: No module named missing_module
82
76
>>> import_object('tornado.missing_module')
83
77
Traceback (most recent call last):
84
78
...
@@ -92,8 +86,8 @@ def import_object(name):
92
86
try :
93
87
return getattr (obj , parts [- 1 ])
94
88
except AttributeError :
95
- exc_info = sys . exc_info ( )
96
- raise ImportError , "No module named %s" % parts [ - 1 ], exc_info [ 2 ]
89
+ raise ImportError ( "No module named %s" % parts [ - 1 ] )
90
+
97
91
98
92
# Fake unicode literal support: Python 3.2 doesn't have the u'' marker for
99
93
# literal strings, and alternative solutions like "from __future__ import
You can’t perform that action at this time.
0 commit comments