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
ae137ef7
Commit
ae137ef7
authored
Jan 24, 2011
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debugger: Python 3 compatibility testsuite
parent
d8647256
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
Cython/Debugger/Tests/test_libcython_in_gdb.py
Cython/Debugger/Tests/test_libcython_in_gdb.py
+4
-1
Cython/Debugger/Tests/test_libpython_in_gdb.py
Cython/Debugger/Tests/test_libpython_in_gdb.py
+3
-3
Cython/Debugger/libpython.py
Cython/Debugger/libpython.py
+1
-1
No files found.
Cython/Debugger/Tests/test_libcython_in_gdb.py
View file @
ae137ef7
...
@@ -232,7 +232,10 @@ class TestStep(DebugStepperTestCase):
...
@@ -232,7 +232,10 @@ class TestStep(DebugStepperTestCase):
self
.
assertEqual
(
curframe
.
name
(),
'PyEval_EvalFrameEx'
)
self
.
assertEqual
(
curframe
.
name
(),
'PyEval_EvalFrameEx'
)
pyframe
=
libpython
.
Frame
(
curframe
).
get_pyop
()
pyframe
=
libpython
.
Frame
(
curframe
).
get_pyop
()
self
.
assertEqual
(
str
(
pyframe
.
co_name
),
'join'
)
# With Python 3 inferiors, pyframe.co_name will return a PyUnicodePtr,
# be compatible
frame_name
=
pyframe
.
co_name
.
proxyval
(
set
())
self
.
assertEqual
(
frame_name
,
'join'
)
assert
re
.
match
(
r'\
d+ de
f join\
(
', result), result
assert
re
.
match
(
r'\
d+ de
f join\
(
', result), result
...
...
Cython/Debugger/Tests/test_libpython_in_gdb.py
View file @
ae137ef7
...
@@ -52,14 +52,14 @@ class TestPrettyPrinters(test_libcython_in_gdb.DebugTestCase):
...
@@ -52,14 +52,14 @@ class TestPrettyPrinters(test_libcython_in_gdb.DebugTestCase):
def
alloc_bytestring
(
self
,
string
,
gdbvar
=
None
):
def
alloc_bytestring
(
self
,
string
,
gdbvar
=
None
):
if
inferior_python_version
<
(
3
,
0
):
if
inferior_python_version
<
(
3
,
0
):
funcname
=
'PyString_FromString'
funcname
=
'PyString_FromString
AndSize
'
else
:
else
:
funcname
=
'PyBytes_FromString'
funcname
=
'PyBytes_FromString
AndSize
'
assert
'"'
not
in
string
assert
'"'
not
in
string
# ensure double quotes
# ensure double quotes
code
=
'(PyObject *) %s("%s"
)'
%
(
funcname
,
string
)
code
=
'(PyObject *) %s("%s"
, %d)'
%
(
funcname
,
string
,
len
(
string
)
)
return
self
.
pyobject_fromcode
(
code
,
gdbvar
=
gdbvar
)
return
self
.
pyobject_fromcode
(
code
,
gdbvar
=
gdbvar
)
def
alloc_unicodestring
(
self
,
string
,
gdbvar
=
None
):
def
alloc_unicodestring
(
self
,
string
,
gdbvar
=
None
):
...
...
Cython/Debugger/libpython.py
View file @
ae137ef7
...
@@ -2281,7 +2281,7 @@ class PythonCodeExecutor(object):
...
@@ -2281,7 +2281,7 @@ class PythonCodeExecutor(object):
except
RuntimeError
:
except
RuntimeError
:
# Python 3
# Python 3
PyString_FromStringAndSize
=
(
'PyUnicode%s_FromStringAndSize'
%
PyString_FromStringAndSize
=
(
'PyUnicode%s_FromStringAndSize'
%
(
get_inferior_unicode_postfix
,))
(
get_inferior_unicode_postfix
()
,))
try
:
try
:
result
=
gdb
.
parse_and_eval
(
result
=
gdb
.
parse_and_eval
(
...
...
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