File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 30
30
else :
31
31
import __builtin__ as builtins
32
32
33
+ if sys .platform == 'darwin' and __file__ .startswith ('/var' ):
34
+ # See https://bitbucket.org/pypy/numpy/issues/21. Basically, a pip
35
+ # install from a git checkout gets /var and /private/var confused
36
+ # on OS X. The former is a symlink to the later, and used as
37
+ # $TMPDIR (to which the checkout is copied), and pip
38
+ # reads-and-evals this setup.py directly and sets __file__ to
39
+ # something underneath $TMPDIR. Meanwhile, when the rest of the
40
+ # code is executed by the python interpreter, it gets the complete path
41
+ # starting with /private. This confuses numpy.distutils.misc_util:rel_path
42
+ # and breaks shared libraries.
43
+ # So to fix it, we change our __file__ because it's the least invasive thing to
44
+ # do. This should only happen from git checkouts, pip uses a different mechanism
45
+ # for tarballs. The OS X filesystem layout is also unlikely to change.
46
+ __file__ = '/private' + __file__
33
47
34
48
CLASSIFIERS = """\
35
49
Development Status :: 5 - Production/Stable
You can’t perform that action at this time.
0 commit comments