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
3b8a1a8c
Commit
3b8a1a8c
authored
Jan 09, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix subclassing non-GC types like 'unicode'
parent
ef7778b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+4
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
3b8a1a8c
...
@@ -723,9 +723,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -723,9 +723,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if
py_attrs
:
if
py_attrs
:
self
.
generate_self_cast
(
scope
,
code
)
self
.
generate_self_cast
(
scope
,
code
)
if
base_type
:
if
base_type
:
code
.
putln
(
"if (%s->tp_traverse) {"
%
base_type
.
typeptr_cname
)
code
.
putln
(
code
.
putln
(
"e = %s->tp_traverse(o, v, a); if (e) return e;"
%
"e = %s->tp_traverse(o, v, a); if (e) return e;"
%
base_type
.
typeptr_cname
)
base_type
.
typeptr_cname
)
code
.
putln
(
"}"
)
for
entry
in
py_attrs
:
for
entry
in
py_attrs
:
var_code
=
"p->%s"
%
entry
.
cname
var_code
=
"p->%s"
%
entry
.
cname
code
.
putln
(
code
.
putln
(
...
@@ -756,9 +758,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -756,9 +758,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if
py_attrs
:
if
py_attrs
:
self
.
generate_self_cast
(
scope
,
code
)
self
.
generate_self_cast
(
scope
,
code
)
if
base_type
:
if
base_type
:
code
.
putln
(
"if (%s->tp_clear) {"
%
base_type
.
typeptr_cname
)
code
.
putln
(
code
.
putln
(
"%s->tp_clear(o);"
%
"%s->tp_clear(o);"
%
base_type
.
typeptr_cname
)
base_type
.
typeptr_cname
)
code
.
putln
(
"}"
)
for
entry
in
py_attrs
:
for
entry
in
py_attrs
:
name
=
"p->%s"
%
entry
.
cname
name
=
"p->%s"
%
entry
.
cname
code
.
put_xdecref
(
name
,
entry
.
type
)
code
.
put_xdecref
(
name
,
entry
.
type
)
...
...
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