File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,15 @@ def pari_share():
40
40
out = gp .communicate (b"print(default(datadir))" )[0 ]
41
41
datadir = out .strip ()
42
42
if not os .path .isdir (datadir ):
43
- raise EnvironmentError ("PARI data directory {!r} does not exist" .format (datadir ))
43
+ # As a fallback, try a path relative to the gp executable.
44
+ # This is useful for broken Conda versions, see
45
+ # https://github.com/conda-forge/pari-feedstock/issues/4
46
+ from distutils .spawn import find_executable
47
+ gppath = find_executable ("gp" )
48
+ if gppath is not None :
49
+ datadir = os .path .join (os .path .dirname (gppath ), ".." , "share" , "pari" )
50
+ if not os .path .isdir (datadir ):
51
+ raise EnvironmentError ("PARI data directory {!r} does not exist" .format (datadir ))
44
52
return datadir
45
53
46
54
You can’t perform that action at this time.
0 commit comments