From af01f668173d4061893148b54a0f01b91c7716c2 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sat, 21 Dec 2013 16:19:10 +0100 Subject: [PATCH] Issue #16136: Remove VMS support and VMS-related code --- Doc/whatsnew/3.4.rst | 1 + Include/pyerrors.h | 3 -- Lib/test/test_pep3151.py | 2 - Misc/NEWS | 2 + Modules/_cryptmodule.c | 7 --- Modules/fcntlmodule.c | 4 -- Modules/fpectlmodule.c | 29 ----------- Modules/getpath.c | 6 +-- Modules/grpmodule.c | 5 -- Modules/main.c | 29 ----------- Modules/mmapmodule.c | 6 --- Modules/posixmodule.c | 23 --------- Modules/pwdmodule.c | 8 --- Modules/selectmodule.c | 25 ++++----- Modules/socketmodule.c | 106 +++------------------------------------ Objects/exceptions.c | 6 --- Parser/myreadline.c | 8 --- Python/dynload_shlib.c | 26 ---------- Python/random.c | 37 ++------------ Python/sysmodule.c | 19 ------- 20 files changed, 27 insertions(+), 325 deletions(-) diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst index 8311a0596d2..d07fa8c1a6a 100644 --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -977,6 +977,7 @@ Unsupported Operating Systems * OS/2 * Windows 2000 +* VMS Deprecated Python modules, functions and methods diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 6a8e0e810e3..ebc027fea38 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -199,9 +199,6 @@ PyAPI_DATA(PyObject *) PyExc_IOError; #ifdef MS_WINDOWS PyAPI_DATA(PyObject *) PyExc_WindowsError; #endif -#ifdef __VMS -PyAPI_DATA(PyObject *) PyExc_VMSError; -#endif PyAPI_DATA(PyObject *) PyExc_RecursionErrorInst; diff --git a/Lib/test/test_pep3151.py b/Lib/test/test_pep3151.py index 2792c10f989..7d4a5d84463 100644 --- a/Lib/test/test_pep3151.py +++ b/Lib/test/test_pep3151.py @@ -157,8 +157,6 @@ class AttributesTest(unittest.TestCase): e.characters_written = 5 self.assertEqual(e.characters_written, 5) - # XXX VMSError not tested - class ExplicitSubclassingTest(unittest.TestCase): diff --git a/Misc/NEWS b/Misc/NEWS index c38a8c474d4..6778ec712d7 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -256,6 +256,8 @@ Tests Build ----- +- Issue #16136: Remove VMS support + - Issue #18215: Add script Tools/ssl/test_multiple_versions.py to compile and run Python's unit tests with multiple versions of OpenSSL. diff --git a/Modules/_cryptmodule.c b/Modules/_cryptmodule.c index 51007889bf8..62aa06cd856 100644 --- a/Modules/_cryptmodule.c +++ b/Modules/_cryptmodule.c @@ -5,19 +5,12 @@ #include -#ifdef __VMS -#include -#endif - /* Module crypt */ static PyObject *crypt_crypt(PyObject *self, PyObject *args) { char *word, *salt; -#ifndef __VMS - extern char * crypt(const char *, const char *); -#endif if (!PyArg_ParseTuple(args, "ss:crypt", &word, &salt)) { return NULL; diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c index 79d292f1ae4..cf0ac19976f 100644 --- a/Modules/fcntlmodule.c +++ b/Modules/fcntlmodule.c @@ -208,11 +208,7 @@ fcntl_ioctl(PyObject *self, PyObject *args) return NULL; } Py_BEGIN_ALLOW_THREADS -#ifdef __VMS - ret = ioctl(fd, code, (void *)arg); -#else ret = ioctl(fd, code, arg); -#endif Py_END_ALLOW_THREADS if (ret < 0) { PyErr_SetFromErrno(PyExc_IOError); diff --git a/Modules/fpectlmodule.c b/Modules/fpectlmodule.c index 6af2f82f707..052b83480da 100644 --- a/Modules/fpectlmodule.c +++ b/Modules/fpectlmodule.c @@ -70,10 +70,6 @@ extern "C" { #if defined(__FreeBSD__) # include -#elif defined(__VMS) -#define __NEW_STARLET -#include -#include #endif #ifndef WANT_SIGFPE_HANDLER @@ -182,23 +178,6 @@ static void fpe_reset(Sigfunc *handler) ieee_set_fp_control(fp_control); PyOS_setsig(SIGFPE, handler); -/*-- DEC ALPHA VMS --------------------------------------------------------*/ -#elif defined(__ALPHA) && defined(__VMS) - IEEE clrmsk; - IEEE setmsk; - clrmsk.ieee$q_flags = - IEEE$M_TRAP_ENABLE_UNF | IEEE$M_TRAP_ENABLE_INE | - IEEE$M_MAP_UMZ; - setmsk.ieee$q_flags = - IEEE$M_TRAP_ENABLE_INV | IEEE$M_TRAP_ENABLE_DZE | - IEEE$M_TRAP_ENABLE_OVF; - sys$ieee_set_fp_control(&clrmsk, &setmsk, 0); - PyOS_setsig(SIGFPE, handler); - -/*-- HP IA64 VMS --------------------------------------------------------*/ -#elif defined(__ia64) && defined(__VMS) - PyOS_setsig(SIGFPE, handler); - /*-- Cray Unicos ----------------------------------------------------------*/ #elif defined(cray) /* UNICOS delivers SIGFPE by default, but no matherr */ @@ -251,14 +230,6 @@ static PyObject *turnoff_sigfpe(PyObject *self,PyObject *args) #ifdef __FreeBSD__ fpresetsticky(fpgetsticky()); fpsetmask(0); -#elif defined(__VMS) - IEEE clrmsk; - clrmsk.ieee$q_flags = - IEEE$M_TRAP_ENABLE_UNF | IEEE$M_TRAP_ENABLE_INE | - IEEE$M_MAP_UMZ | IEEE$M_TRAP_ENABLE_INV | - IEEE$M_TRAP_ENABLE_DZE | IEEE$M_TRAP_ENABLE_OVF | - IEEE$M_INHERIT; - sys$ieee_set_fp_control(&clrmsk, 0, 0); #else fputs("Operation not implemented\n", stderr); #endif diff --git a/Modules/getpath.c b/Modules/getpath.c index 9e79c26b9e4..c057737ec2b 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -110,11 +110,7 @@ #endif #ifndef PREFIX -# ifdef __VMS -# define PREFIX "" -# else -# define PREFIX "/usr/local" -# endif +# define PREFIX "/usr/local" #endif #ifndef EXEC_PREFIX diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c index a85a2715e91..c8a93723eae 100644 --- a/Modules/grpmodule.c +++ b/Modules/grpmodule.c @@ -58,17 +58,12 @@ mkgrent(struct group *p) #define SET(i,val) PyStructSequence_SET_ITEM(v, i, val) SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_name)); -#ifdef __VMS - SET(setIndex++, Py_None); - Py_INCREF(Py_None); -#else if (p->gr_passwd) SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_passwd)); else { SET(setIndex++, Py_None); Py_INCREF(Py_None); } -#endif SET(setIndex++, _PyLong_FromGid(p->gr_gid)); SET(setIndex++, w); #undef SET diff --git a/Modules/main.c b/Modules/main.c index 9171070ab5d..87a21d7c30f 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -5,11 +5,6 @@ #include -#ifdef __VMS -#error "PEP 11: VMS is now unsupported, code will be removed in Python 3.4" -#include -#endif - #if defined(MS_WINDOWS) || defined(__CYGWIN__) #include #ifdef HAVE_FCNTL_H @@ -124,19 +119,7 @@ usage(int exitcode, wchar_t* program) fprintf(f, usage_5, DELIM, PYTHONHOMEHELP); fputs(usage_6, f); } -#if defined(__VMS) - if (exitcode == 0) { - /* suppress 'error' message */ - return 1; - } - else { - /* STS$M_INHIB_MSG + SS$_ABORT */ - return 0x1000002c; - } -#else return exitcode; -#endif - /*NOTREACHED*/ } static void RunStartupFile(PyCompilerFlags *cf) @@ -580,14 +563,7 @@ Py_Main(int argc, wchar_t **argv) if (command == NULL && module == NULL && _PyOS_optind < argc && wcscmp(argv[_PyOS_optind], L"-") != 0) { -#ifdef __VMS - filename = decc$translate_vms(argv[_PyOS_optind]); - if (filename == (char *)0 || filename == (char *)-1) - filename = argv[_PyOS_optind]; - -#else filename = argv[_PyOS_optind]; -#endif } stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0); @@ -623,11 +599,6 @@ Py_Main(int argc, wchar_t **argv) #endif /* !MS_WINDOWS */ /* Leave stderr alone - it should be unbuffered anyway. */ } -#ifdef __VMS - else { - setvbuf (stdout, (char *)NULL, _IOLBF, BUFSIZ); - } -#endif /* __VMS */ #ifdef __APPLE__ /* On MacOS X, when the Python interpreter is embedded in an diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 366dac15e67..07b5c6bcd1d 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -1158,12 +1158,6 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict) (void)fcntl(fd, F_FULLFSYNC); #endif #ifdef HAVE_FSTAT -# ifdef __VMS - /* on OpenVMS we must ensure that all bytes are written to the file */ - if (fd != -1) { - fsync(fd); - } -# endif if (fd != -1 && fstat(fd, &st) == 0 && S_ISREG(st.st_mode)) { if (map_size == 0) { if (st.st_size == 0) { diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index ec70948e220..1258670e726 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -29,11 +29,6 @@ #include "posixmodule.h" #endif -#if defined(__VMS) -# error "PEP 11: VMS is now unsupported, code will be removed in Python 3.4" -# include -#endif /* defined(__VMS) */ - #ifdef __cplusplus extern "C" { #endif @@ -164,9 +159,6 @@ corresponding Unix manual entries for more information on calls."); #define HAVE_FSYNC 1 #define fsync _commit #else -#if defined(__VMS) -/* Everything needed is defined in vms/pyconfig.h */ -#else /* all other compilers */ /* Unix functions that the configure script doesn't check for */ #define HAVE_EXECV 1 #define HAVE_FORK 1 @@ -184,7 +176,6 @@ corresponding Unix manual entries for more information on calls."); #define HAVE_SYSTEM 1 #define HAVE_WAIT 1 #define HAVE_TTYNAME 1 -#endif /* __VMS */ #endif /* _MSC_VER */ #endif /* __BORLANDC__ */ #endif /* ! __WATCOMC__ || __QNX__ */ @@ -2765,17 +2756,7 @@ os_ttyname_impl(PyModuleDef *module, int fd) { char *ret; -#if defined(__VMS) - /* file descriptor 0 only, the default input device (stdin) */ - if (fd == 0) { - ret = ttyname(); - } - else { - ret = NULL; - } -#else ret = ttyname(fd); -#endif if (ret == NULL) posix_error(); return ret; @@ -8340,10 +8321,6 @@ posix_fstat(PyObject *self, PyObject *args) int res; if (!PyArg_ParseTuple(args, "i:fstat", &fd)) return NULL; -#ifdef __VMS - /* on OpenVMS we must ensure that all bytes are written to the file */ - fsync(fd); -#endif Py_BEGIN_ALLOW_THREADS res = FSTAT(fd, &st); Py_END_ALLOW_THREADS diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c index 99094004411..ebb87120180 100644 --- a/Modules/pwdmodule.c +++ b/Modules/pwdmodule.c @@ -69,18 +69,10 @@ mkpwent(struct passwd *p) #define SETS(i,val) sets(v, i, val) SETS(setIndex++, p->pw_name); -#ifdef __VMS - SETS(setIndex++, ""); -#else SETS(setIndex++, p->pw_passwd); -#endif PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromUid(p->pw_uid)); PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromGid(p->pw_gid)); -#ifdef __VMS - SETS(setIndex++, ""); -#else SETS(setIndex++, p->pw_gecos); -#endif SETS(setIndex++, p->pw_dir); SETS(setIndex++, p->pw_shell); diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 0293c8b47b2..d44e8de929c 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -52,9 +52,6 @@ extern void bzero(void *, int); # include #else # define SOCKET int -# if defined(__VMS) -# include -# endif #endif /* list of Python objects and their file descriptor */ @@ -1708,17 +1705,17 @@ static PyTypeObject kqueue_queue_Type; * kevent is not standard and its members vary across BSDs. */ #if !defined(__OpenBSD__) -# define IDENT_TYPE T_UINTPTRT -# define IDENT_CAST Py_intptr_t -# define DATA_TYPE T_INTPTRT +# define IDENT_TYPE T_UINTPTRT +# define IDENT_CAST Py_intptr_t +# define DATA_TYPE T_INTPTRT # define DATA_FMT_UNIT INTPTRT_FMT_UNIT -# define IDENT_AsType PyLong_AsUintptr_t +# define IDENT_AsType PyLong_AsUintptr_t #else -# define IDENT_TYPE T_UINT -# define IDENT_CAST int -# define DATA_TYPE T_INT +# define IDENT_TYPE T_UINT +# define IDENT_CAST int +# define DATA_TYPE T_INT # define DATA_FMT_UNIT "i" -# define IDENT_AsType PyLong_AsUnsignedLong +# define IDENT_AsType PyLong_AsUnsignedLong #endif /* Unfortunately, we can't store python objects in udata, because @@ -1770,7 +1767,7 @@ kqueue_event_init(kqueue_event_Object *self, PyObject *args, PyObject *kwds) if (PyLong_Check(pfd) #if IDENT_TYPE == T_UINT - && PyLong_AsUnsignedLong(pfd) <= UINT_MAX + && PyLong_AsUnsignedLong(pfd) <= UINT_MAX #endif ) { self->e.ident = IDENT_AsType(pfd); @@ -2253,7 +2250,7 @@ arguments; each contains the subset of the corresponding file descriptors\n\ that are ready.\n\ \n\ *** IMPORTANT NOTICE ***\n\ -On Windows and OpenVMS, only sockets are supported; on Unix, all file\n\ +On Windows only sockets are supported; on Unix, all file\n\ descriptors can be used."); static PyMethodDef select_methods[] = { @@ -2271,7 +2268,7 @@ PyDoc_STRVAR(module_doc, "This module supports asynchronous I/O on multiple file descriptors.\n\ \n\ *** IMPORTANT NOTICE ***\n\ -On Windows and OpenVMS, only sockets are supported; on Unix, all file descriptors."); +On Windows only sockets are supported; on Unix, all file descriptors."); static struct PyModuleDef selectmodule = { diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 92d52d11ce5..0aba5911e25 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -188,7 +188,7 @@ if_indextoname(index) -- return the corresponding interface name\n\ #if defined(WITH_THREAD) && (defined(__APPLE__) || \ (defined(__FreeBSD__) && __FreeBSD_version+0 < 503000) || \ defined(__OpenBSD__) || defined(__NetBSD__) || \ - defined(__VMS) || !defined(HAVE_GETADDRINFO)) + !defined(HAVE_GETADDRINFO)) #define USE_GETADDRINFO_LOCK #endif @@ -212,10 +212,6 @@ if_indextoname(index) -- return the corresponding interface name\n\ # include #endif -#if defined(__VMS) -# include -#endif - #ifdef __APPLE__ # include #endif @@ -403,11 +399,6 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); #endif #endif -#ifdef __VMS -/* TCP/IP Services for VMS uses a maximum send/recv buffer length */ -#define SEGMENT_SIZE (32 * 1024 -1) -#endif - /* Convert "sock_addr_t *" to "struct sockaddr *". */ #define SAS2SA(x) (&((x)->sa)) @@ -556,37 +547,13 @@ set_gaierror(int error) return NULL; } -#ifdef __VMS -/* Function to send in segments */ -static int -sendsegmented(int sock_fd, char *buf, int len, int flags) -{ - int n = 0; - int remaining = len; - - while (remaining > 0) { - unsigned int segment; - - segment = (remaining >= SEGMENT_SIZE ? SEGMENT_SIZE : remaining); - n = send(sock_fd, buf, segment, flags); - if (n < 0) { - return n; - } - remaining -= segment; - buf += segment; - } /* end while */ - - return len; -} -#endif - /* Function to perform the setting of socket blocking mode internally. block = (1 | 0). */ static int internal_setblocking(PySocketSockObject *s, int block) { #if !defined(MS_WINDOWS) \ - && !((defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO)) || defined(__VMS)) + && !((defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO))) int delay_flag, new_delay_flag; #endif #ifdef SOCK_NONBLOCK @@ -598,7 +565,7 @@ internal_setblocking(PySocketSockObject *s, int block) Py_BEGIN_ALLOW_THREADS #ifndef MS_WINDOWS -#if (defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO)) || defined(__VMS) +#if (defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO)) block = !block; ioctl(s->sock_fd, FIONBIO, (unsigned int *)&block); #else @@ -2227,13 +2194,7 @@ sock_getsockopt(PySocketSockObject *s, PyObject *args) return s->errorhandler(); return PyLong_FromLong(flag); } -#ifdef __VMS - /* socklen_t is unsigned so no negative test is needed, - test buflen == 0 is previously done */ - if (buflen > 1024) { -#else if (buflen <= 0 || buflen > 1024) { -#endif PyErr_SetString(PyExc_OSError, "getsockopt buflen out of range"); return NULL; @@ -2603,10 +2564,6 @@ sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags) { Py_ssize_t outlen = -1; int timeout; -#ifdef __VMS - int remaining; - char *read_buf; -#endif if (!IS_SELECTABLE(s)) { select_error(); @@ -2617,7 +2574,6 @@ sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags) return 0; } -#ifndef __VMS BEGIN_SELECT_LOOP(s) Py_BEGIN_ALLOW_THREADS timeout = internal_select_ex(s, 0, interval); @@ -2643,48 +2599,6 @@ sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags) s->errorhandler(); return -1; } -#else - read_buf = cbuf; - remaining = len; - while (remaining != 0) { - unsigned int segment; - int nread = -1; - - segment = remaining /SEGMENT_SIZE; - if (segment != 0) { - segment = SEGMENT_SIZE; - } - else { - segment = remaining; - } - - BEGIN_SELECT_LOOP(s) - Py_BEGIN_ALLOW_THREADS - timeout = internal_select_ex(s, 0, interval); - if (!timeout) - nread = recv(s->sock_fd, read_buf, segment, flags); - Py_END_ALLOW_THREADS - if (timeout == 1) { - PyErr_SetString(socket_timeout, "timed out"); - return -1; - } - END_SELECT_LOOP(s) - - if (nread < 0) { - s->errorhandler(); - return -1; - } - if (nread != remaining) { - read_buf += nread; - break; - } - - remaining -= segment; - read_buf += segment; - } - outlen = read_buf - cbuf; -#endif /* !__VMS */ - return outlen; } @@ -3318,9 +3232,7 @@ sock_send(PySocketSockObject *s, PyObject *args) Py_BEGIN_ALLOW_THREADS timeout = internal_select_ex(s, 1, interval); if (!timeout) { -#ifdef __VMS - n = sendsegmented(s->sock_fd, buf, len, flags); -#elif defined(MS_WINDOWS) +#ifdef MS_WINDOWS if (len > INT_MAX) len = INT_MAX; n = send(s->sock_fd, buf, (int)len, flags); @@ -3375,9 +3287,7 @@ sock_sendall(PySocketSockObject *s, PyObject *args) timeout = internal_select(s, 1); n = -1; if (!timeout) { -#ifdef __VMS - n = sendsegmented(s->sock_fd, buf, len, flags); -#elif defined(MS_WINDOWS) +#ifdef MS_WINDOWS if (len > INT_MAX) len = INT_MAX; n = send(s->sock_fd, buf, (int)len, flags); @@ -5310,9 +5220,9 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs) #if defined(__APPLE__) && defined(AI_NUMERICSERV) if ((flags & AI_NUMERICSERV) && (pptr == NULL || (pptr[0] == '0' && pptr[1] == 0))) { /* On OSX upto at least OSX 10.8 getaddrinfo crashes - * if AI_NUMERICSERV is set and the servname is NULL or "0". - * This workaround avoids a segfault in libsystem. - */ + * if AI_NUMERICSERV is set and the servname is NULL or "0". + * This workaround avoids a segfault in libsystem. + */ pptr = "00"; } #endif diff --git a/Objects/exceptions.c b/Objects/exceptions.c index af40bc8feae..bff7f0819e3 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -16,9 +16,6 @@ PyObject *PyExc_IOError = NULL; #ifdef MS_WINDOWS PyObject *PyExc_WindowsError = NULL; #endif -#ifdef __VMS -PyObject *PyExc_VMSError = NULL; -#endif /* The dict map from errno codes to OSError subclasses */ static PyObject *errnomap = NULL; @@ -2472,9 +2469,6 @@ _PyExc_Init(PyObject *bltinmod) INIT_ALIAS(IOError, OSError) #ifdef MS_WINDOWS INIT_ALIAS(WindowsError, OSError) -#endif -#ifdef __VMS - INIT_ALIAS(VMSError, OSError) #endif POST_INIT(EOFError) POST_INIT(RuntimeError) diff --git a/Parser/myreadline.c b/Parser/myreadline.c index a1c4b5c896a..28c7b6d7fff 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -15,10 +15,6 @@ #include "windows.h" #endif /* MS_WINDOWS */ -#ifdef __VMS -extern char* vms__StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt); -#endif - PyThreadState* _PyOS_ReadlineTState; @@ -189,11 +185,7 @@ PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt) if (PyOS_ReadlineFunctionPointer == NULL) { -#ifdef __VMS - PyOS_ReadlineFunctionPointer = vms__StdioReadline; -#else PyOS_ReadlineFunctionPointer = PyOS_StdioReadline; -#endif } #ifdef WITH_THREAD diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c index 888fbfcc68c..5cd1efdf767 100644 --- a/Python/dynload_shlib.c +++ b/Python/dynload_shlib.c @@ -36,25 +36,16 @@ const char *_PyImport_DynLoadFiletab[] = { #ifdef __CYGWIN__ ".dll", #else /* !__CYGWIN__ */ -#ifdef __VMS - ".exe", - ".EXE", -#else /* !__VMS */ "." SOABI ".so", ".abi" PYTHON_ABI_STRING ".so", ".so", -#endif /* __VMS */ #endif /* __CYGWIN__ */ NULL, }; static struct { dev_t dev; -#ifdef __VMS - ino_t ino[3]; -#else ino_t ino; -#endif void *handle; } handles[128]; static int nhandles = 0; @@ -95,29 +86,12 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname, } if (nhandles < 128) { handles[nhandles].dev = statb.st_dev; -#ifdef __VMS - handles[nhandles].ino[0] = statb.st_ino[0]; - handles[nhandles].ino[1] = statb.st_ino[1]; - handles[nhandles].ino[2] = statb.st_ino[2]; -#else handles[nhandles].ino = statb.st_ino; -#endif } } dlopenflags = PyThreadState_GET()->interp->dlopenflags; -#ifdef __VMS - /* VMS currently don't allow a pathname, use a logical name instead */ - /* Concatenate 'python_module_' and shortname */ - /* so "import vms.bar" will use the logical python_module_bar */ - /* As C module use only one name space this is probably not a */ - /* important limitation */ - PyOS_snprintf(pathbuf, sizeof(pathbuf), "python_module_%-.200s", - shortname); - pathname = pathbuf; -#endif - handle = dlopen(pathname, dlopenflags); if (handle == NULL) { diff --git a/Python/random.c b/Python/random.c index de8e9e72c74..cdace0036b0 100644 --- a/Python/random.c +++ b/Python/random.c @@ -68,28 +68,7 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise) #endif /* MS_WINDOWS */ -#ifdef __VMS -/* Use openssl random routine */ -#include -static int -vms_urandom(unsigned char *buffer, Py_ssize_t size, int raise) -{ - if (RAND_pseudo_bytes(buffer, size) < 0) { - if (raise) { - PyErr_Format(PyExc_ValueError, - "RAND_pseudo_bytes"); - } else { - Py_FatalError("Failed to initialize the randomized hash " - "secret using RAND_pseudo_bytes"); - } - return -1; - } - return 0; -} -#endif /* __VMS */ - - -#if !defined(MS_WINDOWS) && !defined(__VMS) +#ifndef MS_WINDOWS static int urandom_fd = -1; /* Read size bytes from /dev/urandom into buffer. @@ -195,7 +174,7 @@ dev_urandom_close(void) } } -#endif /* !defined(MS_WINDOWS) && !defined(__VMS) */ +#endif /* MS_WINDOWS */ /* Fill buffer with pseudo-random bytes generated by a linear congruent generator (LCG): @@ -237,11 +216,7 @@ _PyOS_URandom(void *buffer, Py_ssize_t size) #ifdef MS_WINDOWS return win32_urandom((unsigned char *)buffer, size, 1); #else -# ifdef __VMS - return vms_urandom((unsigned char *)buffer, size, 1); -# else return dev_urandom_python((char*)buffer, size); -# endif #endif } @@ -285,12 +260,8 @@ _PyRandom_Init(void) else { #ifdef MS_WINDOWS (void)win32_urandom(secret, secret_size, 0); -#else /* #ifdef MS_WINDOWS */ -# ifdef __VMS - vms_urandom(secret, secret_size, 0); -# else +#else dev_urandom_noraise(secret, secret_size); -# endif #endif } } @@ -298,7 +269,7 @@ _PyRandom_Init(void) void _PyRandom_Fini(void) { -#if !defined(MS_WINDOWS) && !defined(__VMS) +#ifndef MS_WINDOWS dev_urandom_close(); #endif } diff --git a/Python/sysmodule.c b/Python/sysmodule.c index cf580f10403..976d5a0c37d 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -32,10 +32,6 @@ extern void *PyWin_DLLhModule; extern const char *PyWin_DLLVersionString; #endif -#ifdef __VMS -#include -#endif - #ifdef HAVE_LANGINFO_H #include #include @@ -1867,22 +1863,7 @@ makeargvobject(int argc, wchar_t **argv) if (av != NULL) { int i; for (i = 0; i < argc; i++) { -#ifdef __VMS - PyObject *v; - - /* argv[0] is the script pathname if known */ - if (i == 0) { - char* fn = decc$translate_vms(argv[0]); - if ((fn == (char *)0) || fn == (char *)-1) - v = PyUnicode_FromString(argv[0]); - else - v = PyUnicode_FromString( - decc$translate_vms(argv[0])); - } else - v = PyUnicode_FromString(argv[i]); -#else PyObject *v = PyUnicode_FromWideChar(argv[i], -1); -#endif if (v == NULL) { Py_DECREF(av); av = NULL;