demandimport: remove support for Python < 2.5
The removed code was to support an __import__ function that doesn't
support the "level" argument. This argument was added in Python 2.5,
which we no longer support.
--- a/mercurial/demandimport.py Sat Aug 08 14:42:48 2015 -0700
+++ b/mercurial/demandimport.py Sat Aug 08 15:01:27 2015 -0700
@@ -37,18 +37,11 @@
nothing = object()
-try:
- # Python 3 doesn't have relative imports nor level -1.
- level = -1
- if sys.version_info[0] >= 3:
- level = 0
- _origimport(builtins.__name__, {}, {}, None, level)
-except TypeError: # no level argument
- def _import(name, globals, locals, fromlist, level):
- "call _origimport with no level argument"
- return _origimport(name, globals, locals, fromlist)
-else:
- _import = _origimport
+# Python 3 doesn't have relative imports nor level -1.
+level = -1
+if sys.version_info[0] >= 3:
+ level = 0
+_import = _origimport
def _hgextimport(importfunc, name, globals, *args):
try: