@@ -396,6 +396,15 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent, i |
|
|
396 |
396 |
if (filename == NULL) |
397 |
397 |
return 0; |
398 |
398 |
|
|
399 |
+/* Do not attempt to open things like or */ |
|
400 |
+assert(PyUnicode_Check(filename)); |
|
401 |
+if (PyUnicode_READ_CHAR(filename, 0) == '<') { |
|
402 |
+Py_ssize_t len = PyUnicode_GET_LENGTH(filename); |
|
403 |
+if (len > 0 && PyUnicode_READ_CHAR(filename, len - 1) == '>') { |
|
404 |
+return 0; |
|
405 |
+ } |
|
406 |
+ } |
|
407 |
+ |
399 |
408 |
io = PyImport_ImportModuleNoBlock("io"); |
400 |
409 |
if (io == NULL) |
401 |
410 |
return -1; |