diff -r 09ffaffca750 Lib/os.py --- a/Lib/os.py Sat Feb 04 17:37:00 2017 -0800 +++ b/Lib/os.py Sun Feb 05 01:37:55 2017 -0800 @@ -98,7 +98,7 @@ if _exists("_have_functions"): _globals = globals() def _add(str, fn): - if (fn in _globals) and (str in _have_functions): + if (fn in _globals) and (str is None or str in _have_functions): _set.add(_globals[fn]) _set = set() @@ -137,6 +137,10 @@ _add("HAVE_FPATHCONF", "pathconf") if _exists("statvfs") and _exists("fstatvfs"): # mac os x10.3 _add("HAVE_FSTATVFS", "statvfs") + _add(None, "getxattr") + _add(None, "listxattr") + _add(None, "removexattr") + _add(None, "setxattr") supports_fd = _set _set = set() @@ -174,6 +178,10 @@ _add("HAVE_FSTATAT", "stat") _add("HAVE_UTIMENSAT", "utime") _add("MS_WINDOWS", "stat") + _add(None, "getxattr") + _add(None, "listxattr") + _add(None, "removexattr") + _add(None, "setxattr") supports_follow_symlinks = _set del _set