Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 41eb15e

Browse files
committed
Add explicit comment about disabled code in importstring.
This lets us know the deactivated code is meant for eventual deletion (the replacement was written by T. Kluyver in his 2to3 preparation work, we just need to be sure we have no problems with it in more testing).
1 parent 572d3d7 commit 41eb15e

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

IPython/utils/importstring.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,20 @@ def import_item(name):
2222
"""Import and return bar given the string foo.bar."""
2323
package = '.'.join(name.split('.')[0:-1])
2424
obj = name.split('.')[-1]
25-
# execString = 'from %s import %s' % (package, obj)
26-
# try:
27-
# exec execString
28-
# except SyntaxError:
29-
# raise ImportError("Invalid class specification: %s" % name)
30-
# exec 'temp = %s' % obj
31-
# return temp
25+
26+
# Note: the original code for this was the following. We've left it
27+
# visible for now in case the new implementation shows any problems down
28+
# the road, to make it easier on anyone looking for a problem. This code
29+
# should be removed once we're comfortable we didn't break anything.
30+
31+
## execString = 'from %s import %s' % (package, obj)
32+
## try:
33+
## exec execString
34+
## except SyntaxError:
35+
## raise ImportError("Invalid class specification: %s" % name)
36+
## exec 'temp = %s' % obj
37+
## return temp
38+
3239
if package:
3340
module = __import__(package,fromlist=[obj])
3441
return module.__dict__[obj]

0 commit comments

Comments
 (0)