Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pew/pew.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,12 @@ def sitepackages_dir(env=os.environ.get('VIRTUAL_ENV')):
sys.exit('ERROR: no virtualenv active')
else:
env_python = workon_home / env / env_bin_dir / 'python'
return Path(invoke(str(env_python), '-c',
'from distutils.sysconfig import get_python_lib; print(get_python_lib())').out)
result = invoke(str(env_python), '-c', ('from distutils import sysconfig;'
'print(sysconfig.get_python_lib())'))
if result.returncode == 0:
return Path(result.out)
else:
sys.exit('ERROR: unable to find sitepackages directory')


def add_cmd(argv):
Expand Down