Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
733fbf92
Commit
733fbf92
authored
Oct 30, 2018
by
Stefan Behnel
Committed by
GitHub
Oct 30, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2688 from nicopauss/2685_warn_undeclared
Fix warn.undeclared #2685
parents
38d0c5b8
1e6883c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+4
-0
tests/errors/w_undeclared.pyx
tests/errors/w_undeclared.pyx
+20
-0
No files found.
Cython/Compiler/ParseTreeTransforms.py
View file @
733fbf92
...
...
@@ -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)
...
...
tests/errors/w_undeclared.pyx
0 → 100644
View file @
733fbf92
# 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'
"""
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment