Kaydet (Commit) 0bb83f81 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

merge 3.3 (#17863)

...@@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1? ...@@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1?
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #17863: In the interactive console, don't loop forever if the encoding
can't be fetched from stdin.
- Issue #17867: Raise an ImportError if __import__ is not found in __builtins__. - Issue #17867: Raise an ImportError if __import__ is not found in __builtins__.
- Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3, - Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
......
...@@ -1255,16 +1255,15 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags ...@@ -1255,16 +1255,15 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags
_Py_IDENTIFIER(encoding); _Py_IDENTIFIER(encoding);
if (fp == stdin) { if (fp == stdin) {
/* Fetch encoding from sys.stdin */ /* Fetch encoding from sys.stdin if possible. */
v = PySys_GetObject("stdin"); v = PySys_GetObject("stdin");
if (v == NULL || v == Py_None) if (v && v != Py_None) {
return -1;
oenc = _PyObject_GetAttrId(v, &PyId_encoding); oenc = _PyObject_GetAttrId(v, &PyId_encoding);
if (!oenc) if (oenc)
return -1;
enc = _PyUnicode_AsString(oenc); enc = _PyUnicode_AsString(oenc);
if (enc == NULL) if (!enc)
return -1; PyErr_Clear();
}
} }
v = PySys_GetObject("ps1"); v = PySys_GetObject("ps1");
if (v != NULL) { if (v != NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment