summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-03-22 12:19:50 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-03-22 12:19:50 (GMT)
commit98ba7534322696250267438053fb36cea5b0a85f (patch)
tree73c4d055f0f2f1d01cbce29adf606c337dc6068e /Python
parent96ad2619b208ce8452f8f6bd5127f32e2b097d2c (diff)
parenta4e4e35783d26151be19253ff6dd1c3ec2ca7efa (diff)
downloadcpython-98ba7534322696250267438053fb36cea5b0a85f.zip
cpython-98ba7534322696250267438053fb36cea5b0a85f.tar.gz
cpython-98ba7534322696250267438053fb36cea5b0a85f.tar.bz2
merge 3.2 (#14378)
Diffstat (limited to 'Python')
-rw-r--r--Python/future.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/Python/future.c b/Python/future.c
index d6b653f..978dc25 100644
--- a/Python/future.c
+++ b/Python/future.c
@@ -60,13 +60,6 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, const char *filename)
{
int i, found_docstring = 0, done = 0, prev_line = 0;
- static PyObject *future;
- if (!future) {
- future = PyUnicode_InternFromString("__future__");
- if (!future)
- return 0;
- }
-
if (!(mod->kind == Module_kind || mod->kind == Interactive_kind))
return 1;
@@ -93,7 +86,8 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, const char *filename)
*/
if (s->kind == ImportFrom_kind) {
- if (s->v.ImportFrom.module == future) {
+ PyObject *modname = s->v.ImportFrom.module;
+ if (!PyUnicode_CompareWithASCIIString(modname, "__future__")) {
if (done) {
PyErr_SetString(PyExc_SyntaxError,
ERR_LATE_FUTURE);