# HG changeset patch # User Gregory Szorc # Date 1439071287 25200 # Node ID 1fc6c02782ab85d599745373f53878f6aa552f56 # Parent d491f289045f4dc8e89a0e2dde2cd385a544cf92 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. diff -r d491f289045f -r 1fc6c02782ab mercurial/demandimport.py --- 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: