diff hgdemandimport/__init__.py @ 32423:859496bb6db3

demandimport: add python 3 implementation This implementation uses the new importlib finder/loader functionality available in Python 3.5 and up. # no-check-commit
author Siddharth Agarwal <sid0@fb.com>
date Sun, 21 May 2017 12:23:04 -0700
parents f37f9499fea8
children 8fb5212652ec
line wrap: on
line diff
--- a/hgdemandimport/__init__.py	Sun May 21 12:10:53 2017 -0700
+++ b/hgdemandimport/__init__.py	Sun May 21 12:23:04 2017 -0700
@@ -15,7 +15,10 @@
 
 import sys
 
-from . import demandimportpy2 as demandimport
+if sys.version_info[0] >= 3:
+    from . import demandimportpy3 as demandimport
+else:
+    from . import demandimportpy2 as demandimport
 
 # Extensions can add to this list if necessary.
 ignore = [