Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(94831)

Delta Between Two Patch Sets: Modules/symtablemodule.c

Issue 11619: On Windows, don't encode filenames in the import machinery
Left Patch Set: Created 8 years, 4 months ago
Right Patch Set: Created 5 years, 12 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Modules/parsermodule.c ('k') | Parser/parsetok.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #include "Python.h" 1 #include "Python.h"
2 2
3 #include "code.h" 3 #include "code.h"
4 #include "Python-ast.h" 4 #include "Python-ast.h"
5 #include "symtable.h" 5 #include "symtable.h"
6 6
7 static PyObject * 7 static PyObject *
8 symtable_symtable(PyObject *self, PyObject *args) 8 symtable_symtable(PyObject *self, PyObject *args)
9 { 9 {
10 struct symtable *st; 10 struct symtable *st;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 NULL, 58 NULL,
59 NULL, 59 NULL,
60 NULL 60 NULL
61 }; 61 };
62 62
63 PyMODINIT_FUNC 63 PyMODINIT_FUNC
64 PyInit__symtable(void) 64 PyInit__symtable(void)
65 { 65 {
66 PyObject *m; 66 PyObject *m;
67 67
68 if (PyType_Ready(&PySTEntry_Type) < 0)
69 return NULL;
70
68 m = PyModule_Create(&symtablemodule); 71 m = PyModule_Create(&symtablemodule);
69 if (m == NULL) 72 if (m == NULL)
70 return NULL; 73 return NULL;
71 PyModule_AddIntConstant(m, "USE", USE); 74 PyModule_AddIntMacro(m, USE);
72 PyModule_AddIntConstant(m, "DEF_GLOBAL", DEF_GLOBAL); 75 PyModule_AddIntMacro(m, DEF_GLOBAL);
73 PyModule_AddIntConstant(m, "DEF_LOCAL", DEF_LOCAL); 76 PyModule_AddIntMacro(m, DEF_LOCAL);
74 PyModule_AddIntConstant(m, "DEF_PARAM", DEF_PARAM); 77 PyModule_AddIntMacro(m, DEF_PARAM);
75 PyModule_AddIntConstant(m, "DEF_FREE", DEF_FREE); 78 PyModule_AddIntMacro(m, DEF_FREE);
76 PyModule_AddIntConstant(m, "DEF_FREE_CLASS", DEF_FREE_CLASS); 79 PyModule_AddIntMacro(m, DEF_FREE_CLASS);
77 PyModule_AddIntConstant(m, "DEF_IMPORT", DEF_IMPORT); 80 PyModule_AddIntMacro(m, DEF_IMPORT);
78 PyModule_AddIntConstant(m, "DEF_BOUND", DEF_BOUND); 81 PyModule_AddIntMacro(m, DEF_BOUND);
79 82
80 PyModule_AddIntConstant(m, "TYPE_FUNCTION", FunctionBlock); 83 PyModule_AddIntConstant(m, "TYPE_FUNCTION", FunctionBlock);
81 PyModule_AddIntConstant(m, "TYPE_CLASS", ClassBlock); 84 PyModule_AddIntConstant(m, "TYPE_CLASS", ClassBlock);
82 PyModule_AddIntConstant(m, "TYPE_MODULE", ModuleBlock); 85 PyModule_AddIntConstant(m, "TYPE_MODULE", ModuleBlock);
83 86
84 PyModule_AddIntConstant(m, "OPT_IMPORT_STAR", OPT_IMPORT_STAR); 87 PyModule_AddIntMacro(m, OPT_IMPORT_STAR);
85 PyModule_AddIntConstant(m, "OPT_TOPLEVEL", OPT_TOPLEVEL); 88 PyModule_AddIntMacro(m, OPT_TOPLEVEL);
86 89
87 PyModule_AddIntConstant(m, "LOCAL", LOCAL); 90 PyModule_AddIntMacro(m, LOCAL);
88 PyModule_AddIntConstant(m, "GLOBAL_EXPLICIT", GLOBAL_EXPLICIT); 91 PyModule_AddIntMacro(m, GLOBAL_EXPLICIT);
89 PyModule_AddIntConstant(m, "GLOBAL_IMPLICIT", GLOBAL_IMPLICIT); 92 PyModule_AddIntMacro(m, GLOBAL_IMPLICIT);
90 PyModule_AddIntConstant(m, "FREE", FREE); 93 PyModule_AddIntMacro(m, FREE);
91 PyModule_AddIntConstant(m, "CELL", CELL); 94 PyModule_AddIntMacro(m, CELL);
92 95
93 PyModule_AddIntConstant(m, "SCOPE_OFF", SCOPE_OFFSET); 96 PyModule_AddIntConstant(m, "SCOPE_OFF", SCOPE_OFFSET);
94 PyModule_AddIntConstant(m, "SCOPE_MASK", SCOPE_MASK); 97 PyModule_AddIntMacro(m, SCOPE_MASK);
95 98
96 if (PyErr_Occurred()) { 99 if (PyErr_Occurred()) {
97 Py_DECREF(m); 100 Py_DECREF(m);
98 m = 0; 101 m = 0;
99 } 102 }
100 return m; 103 return m;
101 } 104 }
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+