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
Gwenaël Samain
cython
Commits
ed278eec
Commit
ed278eec
authored
Mar 05, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored get_preprocessor_guard() for readability
parent
ab5c7f03
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+11
-11
No files found.
Cython/Compiler/Nodes.py
View file @
ed278eec
...
...
@@ -1870,17 +1870,17 @@ class FuncDefNode(StatNode, BlockNode):
code
.
putln
(
"}"
)
def
get_preprocessor_guard
(
self
):
entry
=
self
.
entry
is_buffer_slot
=
(
entry
.
name
in
(
"__getbuffer__"
,
"__releasebuffer__"
)
and
entry
.
scope
.
is_c_class_scope
)
if
entry
.
is_special
and
not
is_buffer_slot
:
slot
=
TypeSlots
.
method_name_to_slot
.
get
(
entry
.
name
)
if
slot
:
preprocessor_guard
=
slot
.
preprocessor_guard_code
()
if
(
entry
.
name
==
'__long__'
and
not
entry
.
scope
.
lookup_here
(
'__int__'
))
:
preprocessor_guard
=
None
return
preprocessor_guard
if
not
self
.
entry
.
is_special
:
return
None
name
=
self
.
entry
.
name
slot
=
TypeSlots
.
method_name_to_slot
.
get
(
name
)
if
not
slot
:
return
None
if
name
==
'__long__'
and
not
self
.
entry
.
scope
.
lookup_here
(
'__int__'
):
return
None
if
name
in
(
"__getbuffer__"
,
"__releasebuffer__"
)
and
self
.
entry
.
scope
.
is_c_class_scope
:
return
None
return
slot
.
preprocessor_guard_code
()
class
CFuncDefNode
(
FuncDefNode
):
...
...
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