Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ff232d72
Commit
ff232d72
authored
Mar 03, 2005
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clear internal call error in 'L' format. Fixes #723201.
Backported to 2.4.
parent
f2a8d63e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
Lib/test/test_capi.py
Lib/test/test_capi.py
+13
-1
Misc/NEWS
Misc/NEWS
+2
-0
Python/getargs.c
Python/getargs.c
+1
-0
No files found.
Lib/test/test_capi.py
View file @
ff232d72
# Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
import
sys
import
sys
,
unittest
from
test
import
test_support
import
_testcapi
...
...
@@ -35,6 +35,12 @@ def TestThreadState():
raise
test_support
.
TestFailed
,
\
"Couldn't find main thread correctly in the list"
# Tests which use _testcapi helpers
class
OtherTests
(
unittest
.
TestCase
):
def
test_exc_L
(
self
):
# This used to raise a SystemError(bad internal call)
self
.
assertRaises
(
TypeError
,
_testcapi
.
getargs_L
,
"String"
)
try
:
_testcapi
.
_test_thread_state
have_thread_state
=
True
...
...
@@ -46,3 +52,9 @@ if have_thread_state:
import
threading
t
=
threading
.
Thread
(
target
=
TestThreadState
)
t
.
start
()
def
test_main
():
test_support
.
run_unittest
(
OtherTests
)
if
__name__
==
'__main__'
:
test_main
()
Misc/NEWS
View file @
ff232d72
...
...
@@ -10,6 +10,8 @@ What's New in Python 2.5 alpha 1?
Core and builtins
-----------------
- Bug #723201: Raise a TypeError for passing bad objects to '
L
' format.
- Bug #1124295: the __name__ attribute of file objects was
inadvertently made inaccessible in restricted mode.
...
...
Python/getargs.c
View file @
ff232d72
...
...
@@ -610,6 +610,7 @@ convertsimple(PyObject *arg, char **p_format, va_list *p_va, char *msgbuf,
PY_LONG_LONG
*
p
=
va_arg
(
*
p_va
,
PY_LONG_LONG
*
);
PY_LONG_LONG
ival
=
PyLong_AsLongLong
(
arg
);
if
(
ival
==
(
PY_LONG_LONG
)
-
1
&&
PyErr_Occurred
()
)
{
PyErr_Clear
();
return
converterr
(
"long<L>"
,
arg
,
msgbuf
,
bufsize
);
}
else
{
*
p
=
ival
;
...
...
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