0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-19 08:31:01 +03:00

Python: fix virtualenv with Python 2

This commit is contained in:
Frederik Rietdijk 2020-05-24 09:35:45 +02:00 committed by Frederik Rietdijk
parent 98bcf5d8da
commit f17001afd8
5 changed files with 52 additions and 9 deletions

View file

@ -43,6 +43,10 @@ class TestCasePython(unittest.TestCase):
else:
self.assertEqual(sys.prefix, sys.base_prefix)
@unittest.skipIf(sys.version_info.major==3, "sys.real_prefix is only set by virtualenv in case of Python 2.")
def test_real_prefix(self):
self.assertTrue(hasattr(sys, "real_prefix") == IS_VIRTUALENV)
def test_python_version(self):
self.assertTrue(platform.python_version().startswith(PYTHON_VERSION))