changeset 32726: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	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