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
f2f55e7f
Commit
f2f55e7f
authored
Mar 13, 2019
by
Serhiy Storchaka
Committed by
GitHub
Mar 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-36282: Improved error message for too much positional arguments. (GH-12310)
parent
d53fe5f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
Lib/test/test_call.py
Lib/test/test_call.py
+1
-1
Misc/NEWS.d/next/Core and Builtins/2019-03-13-22-47-28.bpo-36282.zs7RKP.rst
...ore and Builtins/2019-03-13-22-47-28.bpo-36282.zs7RKP.rst
+2
-0
Python/getargs.c
Python/getargs.c
+1
-1
No files found.
Lib/test/test_call.py
View file @
f2f55e7f
...
...
@@ -157,7 +157,7 @@ class CFunctionCallsErrorMessages(unittest.TestCase):
self.assertRaisesRegex(TypeError, msg, {}.__contains__, 0, 1)
def test_varargs3(self):
msg = r"
^
from_bytes
\
(
\
)
takes
at
most
2
positional
arguments
\
(
3
given
\
)
"
msg = r"
^
from_bytes
\
(
\
)
takes
exactly
2
positional
arguments
\
(
3
given
\
)
"
self.assertRaisesRegex(TypeError, msg, int.from_bytes, b'a', 'little', False)
def test_varargs1min(self):
...
...
Misc/NEWS.d/next/Core and Builtins/2019-03-13-22-47-28.bpo-36282.zs7RKP.rst
0 → 100644
View file @
f2f55e7f
Improved error message for too much positional arguments in some builtin
functions.
Python/getargs.c
View file @
f2f55e7f
...
...
@@ -2137,7 +2137,7 @@ vgetargskeywordsfast_impl(PyObject *const *args, Py_ssize_t nargs,
"%.200s%s takes %s %d positional argument%s (%d given)"
,
(
parser
->
fname
==
NULL
)
?
"function"
:
parser
->
fname
,
(
parser
->
fname
==
NULL
)
?
""
:
"()"
,
(
parser
->
min
!=
INT_MAX
)
?
"at most"
:
"exactly"
,
(
parser
->
min
<
parser
->
max
)
?
"at most"
:
"exactly"
,
parser
->
max
,
parser
->
max
==
1
?
""
:
"s"
,
nargs
);
...
...
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