summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ModuleNode.py
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2018-08-10 18:30:38 +0200
committerStefan Behnel <stefan_ml@behnel.de>2018-08-10 18:30:38 +0200
commit8ebe27274eb129cc7d33431a828ed690d38bce91 (patch)
treecd8eaca9d53c8f012a48cf2067401abdf32e11c4 /Cython/Compiler/ModuleNode.py
parent6b6cca3d81a6540cf3ad84d810b5f4a1845df426 (diff)
downloadcython-8ebe27274eb129cc7d33431a828ed690d38bce91.tar.gz
Actually enable the error on PEP-489 module reinitialisation, and add it to the changelog.
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r--Cython/Compiler/ModuleNode.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index c69f48a03..9bbccb86c 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -2333,11 +2333,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
Naming.module_cname,
Naming.pymodinit_module_arg,
))
- # TODO: We should raise an exception here, as long as Cython cannot actually support reinitialisation.
- # code.putln('PyErr_SetString(PyExc_RuntimeError,'
- # ' "Module \'%s\' has already been imported. Re-initialisation is not supported");' %
- # env.module_name)
- # code.putln("return -1;")
+ code.putln('PyErr_SetString(PyExc_RuntimeError,'
+ ' "Module \'%s\' has already been imported. Re-initialisation is not supported.");' %
+ env.module_name)
+ code.putln("return -1;")
code.putln("}")
code.putln("#elif PY_MAJOR_VERSION >= 3")
# Hack: enforce single initialisation also on reimports under different names on Python 3 (with PEP 3121/489).