From 288d1daadaddf6ae35cf666138ba4b5d07449657 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 28 Sep 2017 22:44:27 -0700 Subject: [PATCH] remove support for BSD/OS (closes bpo-31624) (#3812) --- Include/pyport.h | 10 --------- Include/unicodeobject.h | 4 ---- Lib/distutils/util.py | 4 ++-- Lib/sysconfig.py | 4 ++-- Lib/test/test_fcntl.py | 2 +- .../2017-09-28-20-54-52.bpo-31624.11w91_.rst | 1 + Modules/posixmodule.c | 2 +- Python/thread_pthread.h | 21 ------------------- configure | 16 ++------------ configure.ac | 16 ++------------ 10 files changed, 11 insertions(+), 69 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2017-09-28-20-54-52.bpo-31624.11w91_.rst diff --git a/Include/pyport.h b/Include/pyport.h index dbf6db68768..2742e477fd4 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -556,16 +556,6 @@ extern char * _getpty(int *, int, mode_t, int); #include #endif -#if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) -#if !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H) -/* BSDI does not supply a prototype for the 'openpty' and 'forkpty' - functions, even though they are included in libutil. */ -#include -extern int openpty(int *, int *, char *, struct termios *, struct winsize *); -extern pid_t forkpty(int *, char *, struct termios *, struct winsize *); -#endif /* !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H) */ -#endif /* defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) */ - /* On 4.4BSD-descendants, ctype functions serves the whole range of * wchar_t character set rather than single byte code points only. diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 5ca1f87013f..d2a8ec281f1 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -104,10 +104,6 @@ typedef wchar_t Py_UNICODE /* Py_DEPRECATED(3.3) */; #endif #ifdef HAVE_WCHAR_H -/* Work around a cosmetic bug in BSDI 4.x wchar.h; thanks to Thomas Wouters */ -# ifdef _HAVE_BSDI -# include -# endif # include #endif diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 9394c1e0564..83682628ba6 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -53,8 +53,8 @@ def get_platform (): (osname, host, release, version, machine) = os.uname() - # Convert the OS name to lowercase, remove '/' characters - # (to accommodate BSD/OS), and translate spaces (for "Power Macintosh") + # Convert the OS name to lowercase, remove '/' characters, and translate + # spaces (for "Power Macintosh") osname = osname.lower().replace('/', '') machine = machine.replace(' ', '_') machine = machine.replace('/', '-') diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 8dfe1a714d5..9ee4d3185a7 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -632,8 +632,8 @@ def get_platform(): # Try to distinguish various flavours of Unix osname, host, release, version, machine = os.uname() - # Convert the OS name to lowercase, remove '/' characters - # (to accommodate BSD/OS), and translate spaces (for "Power Macintosh") + # Convert the OS name to lowercase, remove '/' characters, and translate + # spaces (for "Power Macintosh") osname = osname.lower().replace('/', '') machine = machine.replace(' ', '_') machine = machine.replace('/', '-') diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py index e3b7ed20a08..acd5c7cc586 100644 --- a/Lib/test/test_fcntl.py +++ b/Lib/test/test_fcntl.py @@ -22,7 +22,7 @@ def get_lockdata(): else: start_len = "qq" - if (sys.platform.startswith(('netbsd', 'freebsd', 'openbsd', 'bsdos')) + if (sys.platform.startswith(('netbsd', 'freebsd', 'openbsd')) or sys.platform == 'darwin'): if struct.calcsize('l') == 8: off_t = 'l' diff --git a/Misc/NEWS.d/next/Build/2017-09-28-20-54-52.bpo-31624.11w91_.rst b/Misc/NEWS.d/next/Build/2017-09-28-20-54-52.bpo-31624.11w91_.rst new file mode 100644 index 00000000000..c329b43c4df --- /dev/null +++ b/Misc/NEWS.d/next/Build/2017-09-28-20-54-52.bpo-31624.11w91_.rst @@ -0,0 +1 @@ +Remove support for BSD/OS. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 83135e536a5..13ff9166e71 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -3967,7 +3967,7 @@ os_nice_impl(PyObject *module, int increment) /* There are two flavours of 'nice': one that returns the new priority (as required by almost all standards out there) and the - Linux/FreeBSD/BSDI one, which returns '0' on success and advices + Linux/FreeBSD one, which returns '0' on success and advices the use of getpriority() to get the new priority. If we are of the nice family that returns the new priority, we diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index ea05b6fbcfe..2dcd107c2ce 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -149,25 +149,6 @@ typedef struct { /* * Initialization. */ - -#if defined(_HAVE_BSDI) -static -void _noop(void) -{ -} - -static void -PyThread__init_thread(void) -{ - /* DO AN INIT BY STARTING THE THREAD */ - static int dummy = 0; - pthread_t thread1; - pthread_create(&thread1, NULL, (void *) _noop, &dummy); - pthread_join(thread1, NULL); -} - -#else /* !_HAVE_BSDI */ - static void PyThread__init_thread(void) { @@ -177,8 +158,6 @@ PyThread__init_thread(void) #endif } -#endif /* !_HAVE_BSDI */ - /* * Thread support. */ diff --git a/configure b/configure index 819dc7a0c16..cef9b6f2189 100755 --- a/configure +++ b/configure @@ -5703,13 +5703,6 @@ $as_echo "no" >&6; } fi rmdir CaseSensitiveTestDir -case $MACHDEP in -bsdos*) - case $CC in - gcc) CC="$CC -D_HAVE_BSDI";; - esac;; -esac - case $ac_sys_system in hp*|HP*) case $CC in @@ -6263,8 +6256,8 @@ fi case $MACHDEP in -bsdos*|hp*|HP*) - # install -d does not work on BSDI or HP-UX +hp*|HP*) + # install -d does not work on HP-UX if test -z "$INSTALL" then INSTALL="${srcdir}/install-sh -c" @@ -9228,9 +9221,6 @@ then Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared' LDCXXSHARED='$(CXX) -shared';; - BSD/OS*/4*) - LDSHARED="gcc -shared" - LDCXXSHARED="g++ -shared";; FreeBSD*) if [ "`$CC -dM -E -