[PATCH 2 of 3 v2 pip-fix] hghave: add check for virtualenv

Augie Fackler raf at durin42.com
Thu Jun 8 10:52:09 EDT 2017


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1496762170 14400
#      Tue Jun 06 11:16:10 2017 -0400
# Node ID 510ffdb1a28bf8acab7ebe9d2c79af4555ac398e
# Parent  5a87da9a24af955df877bef261557e2d63fd5e3a
hghave: add check for virtualenv

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -634,3 +634,12 @@ def has_zstd():
 @check("devfull", "/dev/full special file")
 def has_dev_full():
     return os.path.exists('/dev/full')
+
+ at check("virtualenv", "Python virtualenv support")
+def has_virtualenv():
+    try:
+        import virtualenv
+        virtualenv.ACTIVATE_SH
+        return True
+    except ImportError:
+        return False


More information about the Mercurial-devel mailing list