diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 03ab8dbdfb1e50..6e219271ae9e01 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -8806,14 +8806,14 @@ os_ptsname_impl(PyObject *module, int fd) #if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) || defined(HAVE_LOGIN_TTY) || defined(HAVE_DEV_PTMX) #ifdef HAVE_PTY_H #include -#ifdef HAVE_UTMP_H -#include -#endif /* HAVE_UTMP_H */ #elif defined(HAVE_LIBUTIL_H) #include #elif defined(HAVE_UTIL_H) #include #endif /* HAVE_PTY_H */ +#ifdef HAVE_UTMP_H +#include +#endif /* HAVE_UTMP_H */ #ifdef HAVE_STROPTS_H #include #endif