##// END OF EJS Templates
demandimport: remove support for Python < 2.5...
Gregory Szorc -
r25933:1fc6c027 default
parent child Browse files
Show More
@@ -37,17 +37,10 except ImportError:
37
37
38 nothing = object()
38 nothing = object()
39
39
40 try:
41 # Python 3 doesn't have relative imports nor level -1.
40 # Python 3 doesn't have relative imports nor level -1.
42 level = -1
41 level = -1
43 if sys.version_info[0] >= 3:
42 if sys.version_info[0] >= 3:
44 level = 0
43 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
44 _import = _origimport
52
45
53 def _hgextimport(importfunc, name, globals, *args):
46 def _hgextimport(importfunc, name, globals, *args):
General Comments 0
You need to be logged in to leave comments. Login now