Commits

Hugo Lopes Tavares committed 8868a26

added a global function with a good name, abstracting how it knows about running under virtualenv

  • Participants
  • Parent commits bd0daa8

Comments (0)

Files changed (1)

File pip/locations.py

 import os
 from distutils import sysconfig
 
-if getattr(sys, 'real_prefix', None):
+
+def _running_under_virtualenv():
+    return hasattr(sys, 'real_prefix')
+
+
+if _running_under_virtualenv():
     ## FIXME: is build/ a good name?
     build_prefix = os.path.join(sys.prefix, 'build')
     src_prefix = os.path.join(sys.prefix, 'src')