hghave: add check for virtualenv
authorAugie Fackler <augie@google.com>
Tue, 06 Jun 2017 11:16:10 -0400
changeset 32726 a6e4c4218b71
parent 32725 6c4b58422974
child 32727 c94c1aeb35fb
hghave: add check for virtualenv
tests/hghave.py
--- a/tests/hghave.py	Tue Jun 06 11:02:30 2017 -0400
+++ b/tests/hghave.py	Tue Jun 06 11:16:10 2017 -0400
@@ -634,3 +634,12 @@
 @check("devfull", "/dev/full special file")
 def has_dev_full():
     return os.path.exists('/dev/full')
+
+@check("virtualenv", "Python virtualenv support")
+def has_virtualenv():
+    try:
+        import virtualenv
+        virtualenv.ACTIVATE_SH
+        return True
+    except ImportError:
+        return False