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
Hide 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):
...
@@ -1870,17 +1870,17 @@ class FuncDefNode(StatNode, BlockNode):
code
.
putln
(
"}"
)
code
.
putln
(
"}"
)
def
get_preprocessor_guard
(
self
):
def
get_preprocessor_guard
(
self
):
entry
=
self
.
entry
if
not
self
.
entry
.
is_special
:
is_buffer_slot
=
(
entry
.
name
in
(
"__getbuffer__"
,
"__releasebuffer__"
)
and
return
None
entry
.
scope
.
is_c_class_scope
)
name
=
self
.
entry
.
name
if
entry
.
is_special
and
not
is_buffer_slot
:
slot
=
TypeSlots
.
method_name_to_slot
.
get
(
name
)
slot
=
TypeSlots
.
method_name_to_slot
.
get
(
entry
.
name
)
if
not
slot
:
if
slot
:
return
None
preprocessor_guard
=
slot
.
preprocessor_guard_code
()
if
name
==
'__long__'
and
not
self
.
entry
.
scope
.
lookup_here
(
'__int__'
):
if
(
entry
.
name
==
'__long__'
and
return
None
not
entry
.
scope
.
lookup_here
(
'__int__'
))
:
if
name
in
(
"__getbuffer__"
,
"__releasebuffer__"
)
and
self
.
entry
.
scope
.
is_c_class_scope
:
preprocessor_guard
=
None
return
None
return
preprocessor_guard
return
slot
.
preprocessor_guard_code
()
class
CFuncDefNode
(
FuncDefNode
):
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