summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/exceptions.c13
-rw-r--r--Python/import.c7
2 files changed, 18 insertions, 2 deletions
diff --git a/Python/exceptions.c b/Python/exceptions.c
index 015d45a..16b6738 100644
--- a/Python/exceptions.c
+++ b/Python/exceptions.c
@@ -67,6 +67,7 @@ Exception\n\
| | +-- OSError\n\
| | |\n\
| | +-- WindowsError\n\
+ | | +-- VMSError\n\
| |\n\
| +-- EOFError\n\
| +-- RuntimeError\n\
@@ -643,6 +644,11 @@ PyDoc_STRVAR(OSError__doc__, "OS system call failed.");
PyDoc_STRVAR(WindowsError__doc__, "MS-Windows OS system call failed.");
#endif /* MS_WINDOWS */
+#ifdef __VMS
+static char
+VMSError__doc__[] = "OpenVMS OS system call failed.";
+#endif
+
PyDoc_STRVAR(EOFError__doc__, "Read beyond end of file.");
PyDoc_STRVAR(RuntimeError__doc__, "Unspecified run-time error.");
@@ -1599,6 +1605,9 @@ PyObject *PyExc_ZeroDivisionError;
#ifdef MS_WINDOWS
PyObject *PyExc_WindowsError;
#endif
+#ifdef __VMS
+PyObject *PyExc_VMSError;
+#endif
/* Pre-computed MemoryError instance. Best to create this as early as
* possibly and not wait until a MemoryError is actually raised!
@@ -1650,6 +1659,10 @@ static struct {
{"WindowsError", &PyExc_WindowsError, &PyExc_OSError,
WindowsError__doc__},
#endif /* MS_WINDOWS */
+#ifdef __VMS
+ {"VMSError", &PyExc_VMSError, &PyExc_OSError,
+ VMSError__doc__},
+#endif
{"EOFError", &PyExc_EOFError, 0, EOFError__doc__},
{"RuntimeError", &PyExc_RuntimeError, 0, RuntimeError__doc__},
{"NotImplementedError", &PyExc_NotImplementedError,
diff --git a/Python/import.c b/Python/import.c
index 4d0cdbb..d921d74 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -693,8 +693,11 @@ open_exclusive(char *filename)
#ifdef O_BINARY
|O_BINARY /* necessary for Windows */
#endif
-
- , 0666);
+#ifdef __VMS
+ , 0666, "ctxt=bin", "shr=nil");
+#else
+ , 0666);
+#endif
if (fd < 0)
return NULL;
return fdopen(fd, "wb");