Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 28949:ac487a7f7f2c legacy-trunk
Patch #708495: Port more stuff to OpenVMS.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Sat, 03 May 2003 09:14:54 +0000 |
| parents | 78395e5b4782 |
| children | bf1634b023d5 |
comparison
equal
deleted
inserted
replaced
| 28948:33598e8e49b2 | 28949:ac487a7f7f2c |
|---|---|
| 28 | 28 |
| 29 #ifdef MS_COREDLL | 29 #ifdef MS_COREDLL |
| 30 extern void *PyWin_DLLhModule; | 30 extern void *PyWin_DLLhModule; |
| 31 /* A string loaded from the DLL at startup: */ | 31 /* A string loaded from the DLL at startup: */ |
| 32 extern const char *PyWin_DLLVersionString; | 32 extern const char *PyWin_DLLVersionString; |
| 33 #endif | |
| 34 | |
| 35 #ifdef __VMS | |
| 36 #include <unixlib.h> | |
| 33 #endif | 37 #endif |
| 34 | 38 |
| 35 PyObject * | 39 PyObject * |
| 36 PySys_GetObject(char *name) | 40 PySys_GetObject(char *name) |
| 37 { | 41 { |
| 1048 } | 1052 } |
| 1049 av = PyList_New(argc); | 1053 av = PyList_New(argc); |
| 1050 if (av != NULL) { | 1054 if (av != NULL) { |
| 1051 int i; | 1055 int i; |
| 1052 for (i = 0; i < argc; i++) { | 1056 for (i = 0; i < argc; i++) { |
| 1057 #ifdef __VMS | |
| 1058 PyObject *v; | |
| 1059 | |
| 1060 /* argv[0] is the script pathname if known */ | |
| 1061 if (i == 0) { | |
| 1062 char* fn = decc$translate_vms(argv[0]); | |
| 1063 if ((fn == (char *)0) || fn == (char *)-1) | |
| 1064 v = PyString_FromString(argv[0]); | |
| 1065 else | |
| 1066 v = PyString_FromString( | |
| 1067 decc$translate_vms(argv[0])); | |
| 1068 } else | |
| 1069 v = PyString_FromString(argv[i]); | |
| 1070 #else | |
| 1053 PyObject *v = PyString_FromString(argv[i]); | 1071 PyObject *v = PyString_FromString(argv[i]); |
| 1072 #endif | |
| 1054 if (v == NULL) { | 1073 if (v == NULL) { |
| 1055 Py_DECREF(av); | 1074 Py_DECREF(av); |
| 1056 av = NULL; | 1075 av = NULL; |
| 1057 break; | 1076 break; |
| 1058 } | 1077 } |
