Skip to content
Browse files

bug 748624 - add query_python_site_packages_path(). r=jhammel

  • Loading branch information...
1 parent b133112 commit bb0199390bcfe11e86881daaa50b8597ea9c70f1 @escapewindow escapewindow committed Apr 25, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 mozharness/base/python.py
View
11 mozharness/base/python.py
@@ -45,6 +45,7 @@ class VirtualenvMixin(object):
Depends on OSMixin
'''
python_paths = {}
+ site_packages_path = None
def query_virtualenv_path(self):
c = self.config
@@ -72,6 +73,16 @@ def query_python_path(self, binary="python"):
self.python_paths[binary] = self.query_exe(binary)
return self.python_paths[binary]
+ def query_python_site_packages_path(self):
+ if self.site_packages_path:
+ return self.site_packages_path
+ python = self.query_python_path()
+ self.site_packages_path = self.get_output_from_command(
+ [python, '-c',
+ 'from distutils.sysconfig import get_python_lib; ' + \
+ 'print(get_python_lib())'])
+ return self.site_packages_path
+
def package_versions(self, pip_freeze_output=None, error_level=WARNING):
"""
reads packages from `pip freeze` output and returns a dict of

0 comments on commit bb01993

Please sign in to comment.
Something went wrong with that request. Please try again.