diff -r 4b6e6a77e501 Modules/clinic/posixmodule.c.h --- a/Modules/clinic/posixmodule.c.h Sat Oct 22 03:21:55 2016 +0000 +++ b/Modules/clinic/posixmodule.c.h Sat Oct 22 07:41:51 2016 +0200 @@ -222,6 +222,8 @@ #endif /* defined(HAVE_CTERMID) */ +#if (defined(MS_WINDOWS) || defined(HAVE_CHDIR)) + PyDoc_STRVAR(os_chdir__doc__, "chdir($module, /, path)\n" "--\n" @@ -259,6 +261,8 @@ return return_value; } +#endif /* (defined(MS_WINDOWS) || defined(HAVE_CHDIR)) */ + #if defined(HAVE_FCHDIR) PyDoc_STRVAR(os_fchdir__doc__, @@ -5673,6 +5677,10 @@ #define OS_CTERMID_METHODDEF #endif /* !defined(OS_CTERMID_METHODDEF) */ +#ifndef OS_CHDIR_METHODDEF + #define OS_CHDIR_METHODDEF +#endif /* !defined(OS_CHDIR_METHODDEF) */ + #ifndef OS_FCHDIR_METHODDEF #define OS_FCHDIR_METHODDEF #endif /* !defined(OS_FCHDIR_METHODDEF) */ @@ -6148,4 +6156,4 @@ #ifndef OS_GETRANDOM_METHODDEF #define OS_GETRANDOM_METHODDEF #endif /* !defined(OS_GETRANDOM_METHODDEF) */ -/*[clinic end generated code: output=b9ed5703d2feb0d9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b284af40e511200d input=a9049054013a1b77]*/ diff -r 4b6e6a77e501 Modules/posixmodule.c --- a/Modules/posixmodule.c Sat Oct 22 03:21:55 2016 +0000 +++ b/Modules/posixmodule.c Sat Oct 22 07:41:51 2016 +0200 @@ -2608,6 +2608,7 @@ #endif /* HAVE_CTERMID */ +#if defined(MS_WINDOWS) || defined(HAVE_CHDIR) /*[clinic input] os.chdir @@ -2646,6 +2647,7 @@ Py_RETURN_NONE; } +#endif /* MS_WINDOWS || HAVE_CHDIR */ #ifdef HAVE_FCHDIR diff -r 4b6e6a77e501 configure.ac --- a/configure.ac Sat Oct 22 03:21:55 2016 +0000 +++ b/configure.ac Sat Oct 22 07:41:51 2016 +0200 @@ -3402,9 +3402,9 @@ fi # checks for library functions -AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \ - clock confstr ctermid dup3 execv faccessat fchmod fchmodat fchown fchownat \ - fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \ +AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chdir \ + chown clock confstr ctermid dup3 execv faccessat fchmod fchmodat fchown \ + fchownat fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \ futimens futimes gai_strerror getentropy \ getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \ getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \