echo_file.write(line)
return warn
+_warn_once_seen = {}
+def warn_once(position, message, level=0):
+ if level < LEVEL or message in _warn_once_seen:
+ return
+ warn = CompileWarning(position, message)
+ line = "warning: %s\n" % warn
+ if listing_file:
+ listing_file.write(line)
+ if echo_file:
+ echo_file.write(line)
+ _warn_once_seen[message] = True
+ return warn
+
+
# These functions can be used to momentarily suppress errors.
error_stack = []
import operator
-from Errors import error, warning, InternalError
+from Errors import error, warning, warn_once, InternalError
from Errors import hold_errors, release_errors, held_errors, report_error
from Cython.Utils import UtilityCode
import StringEncoding
# Arrange for a Python version of the string to be pre-allocated
# when coercing to a Python type.
if dst_type.is_pyobject and not self.type.is_pyobject:
+ warn_once(self.pos, "String literals will no longer be Py3 bytes in Cython 0.12.", 1)
node = self.as_py_string_node(env)
else:
node = self