Rearranged code

This commit is contained in:
Andrew Murray 2023-04-05 16:15:42 +10:00
parent d94239ae3d
commit fe4e52deac

View File

@ -473,17 +473,15 @@ class pil_build_ext(build_ext):
lib_root = include_root = root
if lib_root is not None:
if isinstance(lib_root, str):
_add_directory(library_dirs, lib_root)
else:
for lib_dir in lib_root:
_add_directory(library_dirs, lib_dir)
if not isinstance(lib_root, (tuple, list)):
lib_root = (lib_root,)
for lib_dir in lib_root:
_add_directory(library_dirs, lib_dir)
if include_root is not None:
if isinstance(include_root, str):
_add_directory(include_dirs, include_root)
else:
for include_dir in include_root:
_add_directory(include_dirs, include_dir)
if not isinstance(include_root, (tuple, list)):
include_root = (include_root,)
for include_dir in include_root:
_add_directory(include_dirs, include_dir)
# respect CFLAGS/CPPFLAGS/LDFLAGS
for k in ("CFLAGS", "CPPFLAGS", "LDFLAGS"):