summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-12-21 15:19:10 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-12-21 15:19:10 (GMT)
commitaf01f668173d4061893148b54a0f01b91c7716c2 (patch)
tree0931bce7ed986e784415b587ae4b4823e7a6c753 /Python
parent5255b86fba38a5e22a0991772a3c1bbf3edd66cc (diff)
downloadcpython-af01f668173d4061893148b54a0f01b91c7716c2.zip
cpython-af01f668173d4061893148b54a0f01b91c7716c2.tar.gz
cpython-af01f668173d4061893148b54a0f01b91c7716c2.tar.bz2
Issue #16136: Remove VMS support and VMS-related code
Diffstat (limited to 'Python')
-rw-r--r--Python/dynload_shlib.c26
-rw-r--r--Python/random.c37
-rw-r--r--Python/sysmodule.c19
3 files changed, 4 insertions, 78 deletions
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
index 888fbfc..5cd1efd 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 de8e9e7..cdace00 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 <openssl/rand.h>
-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 cf580f1..976d5a0 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 <unixlib.h>
-#endif
-
#ifdef HAVE_LANGINFO_H
#include <locale.h>
#include <langinfo.h>
@@ -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;