[apycotlib] fix 'pyversions' compliant with virtualenv draft
authorDavid Douard <david.douard@logilab.fr>
Sun, 26 Oct 2014 22:42:02 +0100
changeset 1767 b99269e6e477
parent 1766 42e60f760703
child 1768 48066736c862
[apycotlib] fix 'pyversions' compliant with virtualenv When executed in virtualenv, there is only one python "version" available...
_apycotlib/__init__.py
--- a/_apycotlib/__init__.py	Sun Oct 26 18:28:22 2014 +0100
+++ b/_apycotlib/__init__.py	Sun Oct 26 22:42:02 2014 +0100
@@ -358,6 +358,8 @@
 
 @cached
 def pyversions(test):
+    if 'VIRTUAL_ENV' in os.environ:
+        return ['python']
     config = test.apycot_config()
     tested_pyversions = config.get('tested_python_versions')
     if tested_pyversions: