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