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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
069a83bc
Commit
069a83bc
authored
Feb 20, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unicode fixes
parent
b33174e7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
Cython/Runtime/refnanny.pyx
Cython/Runtime/refnanny.pyx
+10
-10
No files found.
Cython/Runtime/refnanny.pyx
View file @
069a83bc
...
@@ -23,9 +23,9 @@ class Context(object):
...
@@ -23,9 +23,9 @@ class Context(object):
self
.
errors
=
[]
self
.
errors
=
[]
def
regref
(
self
,
obj
,
lineno
,
is_null
):
def
regref
(
self
,
obj
,
lineno
,
is_null
):
log
(
LOG_ALL
,
'regref'
,
"<NULL>"
if
is_null
else
obj
,
lineno
)
log
(
LOG_ALL
,
u'regref'
,
u
"<NULL>"
if
is_null
else
obj
,
lineno
)
if
is_null
:
if
is_null
:
self
.
errors
.
append
(
"NULL argument on line %d"
%
lineno
)
self
.
errors
.
append
(
u
"NULL argument on line %d"
%
lineno
)
return
return
id_
=
id
(
obj
)
id_
=
id
(
obj
)
count
,
linenumbers
=
self
.
refs
.
get
(
id_
,
(
0
,
[]))
count
,
linenumbers
=
self
.
refs
.
get
(
id_
,
(
0
,
[]))
...
@@ -33,14 +33,14 @@ class Context(object):
...
@@ -33,14 +33,14 @@ class Context(object):
linenumbers
.
append
(
lineno
)
linenumbers
.
append
(
lineno
)
def
delref
(
self
,
obj
,
lineno
,
is_null
):
def
delref
(
self
,
obj
,
lineno
,
is_null
):
log
(
LOG_ALL
,
'delref'
,
"<NULL>"
if
is_null
else
obj
,
lineno
)
log
(
LOG_ALL
,
u'delref'
,
u
"<NULL>"
if
is_null
else
obj
,
lineno
)
if
is_null
:
if
is_null
:
self
.
errors
.
append
(
"NULL argument on line %d"
%
lineno
)
self
.
errors
.
append
(
u
"NULL argument on line %d"
%
lineno
)
return
return
id_
=
id
(
obj
)
id_
=
id
(
obj
)
count
,
linenumbers
=
self
.
refs
.
get
(
id_
,
(
0
,
[]))
count
,
linenumbers
=
self
.
refs
.
get
(
id_
,
(
0
,
[]))
if
count
==
0
:
if
count
==
0
:
self
.
errors
.
append
(
"Too many decrefs on line %d, reference acquired on lines %r"
%
self
.
errors
.
append
(
u
"Too many decrefs on line %d, reference acquired on lines %r"
%
(
lineno
,
linenumbers
))
(
lineno
,
linenumbers
))
elif
count
==
1
:
elif
count
==
1
:
del
self
.
refs
[
id_
]
del
self
.
refs
[
id_
]
...
@@ -49,12 +49,12 @@ class Context(object):
...
@@ -49,12 +49,12 @@ class Context(object):
def
end
(
self
):
def
end
(
self
):
if
len
(
self
.
refs
)
>
0
:
if
len
(
self
.
refs
)
>
0
:
msg
=
""
msg
=
u
""
for
count
,
linenos
in
self
.
refs
.
itervalues
():
for
count
,
linenos
in
self
.
refs
.
itervalues
():
msg
+=
"
\
n
Acquired on lines: "
+
", "
.
join
([
"%d"
%
x
for
x
in
linenos
])
msg
+=
u"
\
n
Acquired on lines: "
+
u", "
.
join
([
u
"%d"
%
x
for
x
in
linenos
])
self
.
errors
.
append
(
"References leaked: %s"
%
msg
)
self
.
errors
.
append
(
u
"References leaked: %s"
%
msg
)
if
self
.
errors
:
if
self
.
errors
:
return
"
\
n
"
.
join
(
self
.
errors
)
return
u
"
\
n
"
.
join
(
self
.
errors
)
else
:
else
:
return
None
return
None
...
@@ -134,7 +134,7 @@ cdef int FinishContext(PyObject** ctx) except -1:
...
@@ -134,7 +134,7 @@ cdef int FinishContext(PyObject** ctx) except -1:
Py_XDECREF
(
<
object
>
ctx
[
0
])
Py_XDECREF
(
<
object
>
ctx
[
0
])
ctx
[
0
]
=
NULL
ctx
[
0
]
=
NULL
if
errors
:
if
errors
:
print
"%s: %s()"
%
pos
print
u
"%s: %s()"
%
pos
print
errors
# raise Error(errors)
print
errors
# raise Error(errors)
return
0
return
0
...
...
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