demandimport: use absolute_import
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 08 Aug 2015 19:05:28 -0700
changeset 25943 3beed01daff9
parent 25942 015ded095933
child 25944 337d010f31e6
demandimport: use absolute_import
mercurial/demandimport.py
--- 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()