Commit 5ac3fb63 authored by Robert Bradshaw's avatar Robert Bradshaw

2.3 compatability, error message tests

parent ce72af67
...@@ -150,11 +150,12 @@ class Context: ...@@ -150,11 +150,12 @@ class Context:
name = source_filename.decode(filename_encoding) name = source_filename.decode(filename_encoding)
try: try:
s = PyrexScanner(f, name, source_encoding = f.encoding, try:
type_names = type_names, context = self) s = PyrexScanner(f, name, source_encoding = f.encoding,
tree = Parsing.p_module(s, pxd, full_module_name) type_names = type_names, context = self)
except UnicodeDecodeError, msg: tree = Parsing.p_module(s, pxd, full_module_name)
error((name, 0, 0), "Decoding error, set coding=<encoding-name> at top of source (%s)" % msg) except UnicodeDecodeError, msg:
error((name, 0, 0), "Decoding error, missing or incorrect coding=<encoding-name> at top of source (%s)" % msg)
finally: finally:
f.close() f.close()
if Errors.num_errors > 0: if Errors.num_errors > 0:
......
# coding=ASCII
"""
Trs bien.
"""
_ERRORS = """
0:0:Decoding error, missing or incorrect coding=<encoding-name> at top of source ('ascii' codec can't decode byte 0x8f in position 22: ordinal not in range(128))
"""
cdef extern from *:
void foo(void)
_ERRORS = """
2:13:Use spam() rather than spam(void) to declare a function with no arguments.
"""
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