Skip to content

Commit

Permalink
fix py 2.7 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jan 4, 2024
1 parent 0fef4a9 commit ae67214
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ def get_winver():
],
# extra_compile_args=["/W 4"],
# extra_link_args=["/DEBUG"],
**py_limited_api, # noqa (noqa needed for python 2.7)
# fmt: off
**py_limited_api # python 2.7 compatibility requires no comma
# fmt: on
)

elif MACOS:
Expand All @@ -262,7 +264,9 @@ def get_winver():
'-framework',
'IOKit',
],
**py_limited_api,
# fmt: off
**py_limited_api # python 2.7 compatibility requires no comma
# fmt: on
)

elif FREEBSD:
Expand All @@ -277,7 +281,9 @@ def get_winver():
),
define_macros=macros,
libraries=["devstat"],
**py_limited_api,
# fmt: off
**py_limited_api # python 2.7 compatibility requires no comma
# fmt: on
)

elif OPENBSD:
Expand All @@ -292,7 +298,9 @@ def get_winver():
),
define_macros=macros,
libraries=["kvm"],
**py_limited_api,
# fmt: off
**py_limited_api # python 2.7 compatibility requires no comma
# fmt: on
)

elif NETBSD:
Expand All @@ -307,7 +315,9 @@ def get_winver():
),
define_macros=macros,
libraries=["kvm"],
**py_limited_api,
# fmt: off
**py_limited_api # python 2.7 compatibility requires no comma
# fmt: on
)

elif LINUX:
Expand All @@ -324,7 +334,9 @@ def get_winver():
+ glob.glob("psutil/arch/linux/*.c")
),
define_macros=macros,
**py_limited_api,
# fmt: off
**py_limited_api # python 2.7 compatibility requires no comma
# fmt: on
)

elif SUNOS:
Expand All @@ -339,7 +351,9 @@ def get_winver():
],
define_macros=macros,
libraries=['kstat', 'nsl', 'socket'],
**py_limited_api,
# fmt: off
**py_limited_api # python 2.7 compatibility requires no comma
# fmt: on
)

elif AIX:
Expand All @@ -355,7 +369,9 @@ def get_winver():
],
libraries=['perfstat'],
define_macros=macros,
**py_limited_api,
# fmt: off
**py_limited_api # python 2.7 compatibility requires no comma
# fmt: on
)

else:
Expand All @@ -367,7 +383,9 @@ def get_winver():
'psutil._psutil_posix',
define_macros=macros,
sources=sources,
**py_limited_api,
# fmt: off
**py_limited_api # python 2.7 compatibility requires no comma
# fmt: on
)
if SUNOS:

Expand Down

0 comments on commit ae67214

Please sign in to comment.