Show More
@@ -37,18 +37,11 b' except ImportError:' | |||
|
37 | 37 | |
|
38 | 38 | nothing = object() |
|
39 | 39 | |
|
40 | try: | |
|
41 | # Python 3 doesn't have relative imports nor level -1. | |
|
42 | level = -1 | |
|
43 | if sys.version_info[0] >= 3: | |
|
44 | level = 0 | |
|
45 | _origimport(builtins.__name__, {}, {}, None, level) | |
|
46 | except TypeError: # no level argument | |
|
47 | def _import(name, globals, locals, fromlist, level): | |
|
48 | "call _origimport with no level argument" | |
|
49 | return _origimport(name, globals, locals, fromlist) | |
|
50 | else: | |
|
51 | _import = _origimport | |
|
40 | # Python 3 doesn't have relative imports nor level -1. | |
|
41 | level = -1 | |
|
42 | if sys.version_info[0] >= 3: | |
|
43 | level = 0 | |
|
44 | _import = _origimport | |
|
52 | 45 | |
|
53 | 46 | def _hgextimport(importfunc, name, globals, *args): |
|
54 | 47 | try: |
General Comments 0
You need to be logged in to leave comments.
Login now