Commit 733fbf92 authored by Stefan Behnel's avatar Stefan Behnel Committed by GitHub

Merge pull request #2688 from nicopauss/2685_warn_undeclared

Fix warn.undeclared #2685
parents 38d0c5b8 1e6883c1
......@@ -1707,6 +1707,8 @@ if VALUE is not None:
# so it can be pickled *after* self is memoized.
unpickle_func = TreeFragment(u"""
def %(unpickle_func_name)s(__pyx_type, long __pyx_checksum, __pyx_state):
cdef object __pyx_PickleError
cdef object __pyx_result
if __pyx_checksum != %(checksum)s:
from pickle import PickleError as __pyx_PickleError
raise __pyx_PickleError("Incompatible checksums (%%s vs %(checksum)s = (%(members)s))" %% __pyx_checksum)
......@@ -1735,6 +1737,8 @@ if VALUE is not None:
pickle_func = TreeFragment(u"""
def __reduce_cython__(self):
cdef tuple state
cdef object _dict
cdef bint use_setstate
state = (%(members)s)
_dict = getattr(self, '__dict__', None)
......
# cython: warn.undeclared=True
# mode: error
# tag: werror
def foo():
a = 1
return a
cdef class Bar:
cdef int baz(self, a):
res = 0
for i in range(3):
res += i
return res
_ERRORS = """
6:4: implicit declaration of 'a'
11:8: implicit declaration of 'res'
12:12: implicit declaration of 'i'
"""
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