Skip to content

Commit 0a69992

Browse files
committed
Only add sys.__getattr__ on Windows
1 parent abc1638 commit 0a69992

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Python/sysmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,7 @@ sys_exit_impl(PyObject *module, PyObject *status)
977977
// This function is used to warn about the future change of sys.abiflags
978978
// from absent to a meaningful value on all platforms.
979979
// It can be removed when the change is made.
980+
#ifndef ABIFLAGS
980981
static PyObject *
981982
sys___getattr__(PyObject *module, PyObject *name)
982983
{
@@ -997,6 +998,7 @@ PyDoc_STRVAR(__getattr___doc,
997998
"\n"
998999
"Get a sys attribute by name.\n"
9991000
);
1001+
#endif
10001002

10011003

10021004
static PyObject *
@@ -2729,8 +2731,10 @@ static PyMethodDef sys_methods[] = {
27292731
SYS_EXC_INFO_METHODDEF
27302732
SYS_EXCEPTHOOK_METHODDEF
27312733
SYS_EXIT_METHODDEF
2734+
#ifndef ABIFLAGS
27322735
{"__getattr__", _PyCFunction_CAST(sys___getattr__),
27332736
METH_O, __getattr___doc},
2737+
#endif
27342738
SYS_GETDEFAULTENCODING_METHODDEF
27352739
SYS_GETDLOPENFLAGS_METHODDEF
27362740
SYS_GETALLOCATEDBLOCKS_METHODDEF

0 commit comments

Comments
 (0)