summaryrefslogtreecommitdiff
path: root/cffi/api.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2016-02-19 10:37:26 +0100
committerArmin Rigo <arigo@tunes.org>2016-02-19 10:37:26 +0100
commit11e551048da4dd36c488646acb77431a269a496a (patch)
tree06089d83bd6c2bf034e819679cb3e39856759ba0 /cffi/api.py
parent6bdddc4134898be19c1117d8b63be49446269ce5 (diff)
downloadcffi-11e551048da4dd36c488646acb77431a269a496a.tar.gz
more pypy tweaks
Diffstat (limited to 'cffi/api.py')
-rw-r--r--cffi/api.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/cffi/api.py b/cffi/api.py
index 70ef93a..289bac3 100644
--- a/cffi/api.py
+++ b/cffi/api.py
@@ -550,6 +550,7 @@ class FFI(object):
lst.append(value)
#
if '__pypy__' in sys.builtin_module_names:
+ import os
if sys.platform == "win32":
# we need 'libpypy-c.lib'. Current distributions of
# pypy (>= 4.1) contain it as 'libs/python27.lib'.
@@ -558,11 +559,15 @@ class FFI(object):
ensure('library_dirs', os.path.join(sys.prefix, 'libs'))
else:
# we need 'libpypy-c.{so,dylib}', which should be by
- # default located in 'sys.prefix/bin'
+ # default located in 'sys.prefix/bin' for installed
+ # systems.
pythonlib = "pypy-c"
if hasattr(sys, 'prefix'):
- import os
ensure('library_dirs', os.path.join(sys.prefix, 'bin'))
+ # On uninstalled pypy's, the libpypy-c is typically found in
+ # .../pypy/goal/.
+ if hasattr(sys, 'prefix'):
+ ensure('library_dirs', os.path.join(sys.prefix, 'pypy', 'goal'))
else:
if sys.platform == "win32":
template = "python%d%d"