Mercurial > hg
changeset 25943:3beed01daff9
demandimport: use absolute_import
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 08 Aug 2015 19:05:28 -0700 |
parents | 015ded095933 |
children | 337d010f31e6 |
files | mercurial/demandimport.py |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/demandimport.py Sat Aug 08 19:04:09 2015 -0700 +++ b/mercurial/demandimport.py Sat Aug 08 19:05:28 2015 -0700 @@ -24,8 +24,11 @@ b = __import__(a) ''' -import os, sys -from contextlib import contextmanager +from __future__ import absolute_import + +import contextlib +import os +import sys # __builtin__ in Python 2, builtins in Python 3. try: @@ -33,6 +36,8 @@ except ImportError: import builtins +contextmanager = contextlib.contextmanager + _origimport = __import__ nothing = object()