changeset 33509:a6e4c4218b71

hghave: add check for virtualenv
author Augie Fackler <augie@google.com>
date Tue, 06 Jun 2017 11:16:10 -0400
parents 6c4b58422974
children c94c1aeb35fb
files tests/hghave.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -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