mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Merge pull request #132 from cyisfor/master
Linux platform.processor() returns valid crazy string sometimes
This commit is contained in:
commit
541d73895d
19
setup.py
19
setup.py
|
@ -127,16 +127,17 @@ class pil_build_ext(build_ext):
|
|||
_add_directory(include_dirs, "/usr/X11/include")
|
||||
|
||||
elif sys.platform.startswith("linux"):
|
||||
platform_ = platform.processor()
|
||||
if not platform_:
|
||||
platform_ = platform.architecture()[0]
|
||||
for platform_ in (platform.processor(),platform.architecture()[0]):
|
||||
if not platform_: continue
|
||||
|
||||
if platform_ in ["x86_64", "64bit"]:
|
||||
_add_directory(library_dirs, "/lib64")
|
||||
_add_directory(library_dirs, "/usr/lib64")
|
||||
_add_directory(library_dirs, "/usr/lib/x86_64-linux-gnu")
|
||||
elif platform_ in ["i386", "i686", "32bit"]:
|
||||
_add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
|
||||
if platform_ in ["x86_64", "64bit"]:
|
||||
_add_directory(library_dirs, "/lib64")
|
||||
_add_directory(library_dirs, "/usr/lib64")
|
||||
_add_directory(library_dirs, "/usr/lib/x86_64-linux-gnu")
|
||||
break
|
||||
elif platform_ in ["i386", "i686", "32bit"]:
|
||||
_add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
|
||||
break
|
||||
else:
|
||||
raise ValueError("Unable to identify Linux platform: `%s`" % platform_)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user