Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
1426daa4
Kaydet (Commit)
1426daa4
authored
6 years ago
tarafından
Xtreak
Kaydeden (comit)
Raymond Hettinger
6 years ago
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-34127: Fix grammar in error message with respect to argument count (GH-8395)
üst
c75c1e0e
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
test_call.py
Lib/test/test_call.py
+16
-0
2018-07-22-14-58-06.bpo-34127.qkfnHO.rst
...EWS.d/next/C API/2018-07-22-14-58-06.bpo-34127.qkfnHO.rst
+2
-0
getargs.c
Python/getargs.c
+4
-4
No files found.
Lib/test/test_call.py
Dosyayı görüntüle @
1426daa4
...
...
@@ -143,6 +143,22 @@ class CFunctionCallsErrorMessages(unittest.TestCase):
msg
=
r"^from_bytes\(\) takes at most 2 positional arguments \(3 given\)"
self
.
assertRaisesRegex
(
TypeError
,
msg
,
int
.
from_bytes
,
b
'a'
,
'little'
,
False
)
def
test_varargs4
(
self
):
msg
=
r"get expected at least 1 argument, got 0"
self
.
assertRaisesRegex
(
TypeError
,
msg
,
{}
.
get
)
def
test_varargs5
(
self
):
msg
=
r"getattr expected at least 2 arguments, got 0"
self
.
assertRaisesRegex
(
TypeError
,
msg
,
getattr
)
def
test_varargs6
(
self
):
msg
=
r"input expected at most 1 argument, got 2"
self
.
assertRaisesRegex
(
TypeError
,
msg
,
input
,
1
,
2
)
def
test_varargs7
(
self
):
msg
=
r"get expected at most 2 arguments, got 3"
self
.
assertRaisesRegex
(
TypeError
,
msg
,
{}
.
get
,
1
,
2
,
3
)
def
test_varargs1_kw
(
self
):
msg
=
r"__contains__\(\) takes no keyword arguments"
self
.
assertRaisesRegex
(
TypeError
,
msg
,
{}
.
__contains__
,
x
=
2
)
...
...
This diff is collapsed.
Click to expand it.
Misc/NEWS.d/next/C API/2018-07-22-14-58-06.bpo-34127.qkfnHO.rst
0 → 100644
Dosyayı görüntüle @
1426daa4
Return grammatically correct error message based on argument count.
Patch by Karthikeyan Singaravelan.
This diff is collapsed.
Click to expand it.
Python/getargs.c
Dosyayı görüntüle @
1426daa4
...
...
@@ -2411,8 +2411,8 @@ unpack_stack(PyObject *const *args, Py_ssize_t nargs, const char *name,
if
(
name
!=
NULL
)
PyErr_Format
(
PyExc_TypeError
,
"%.200s expected %s%zd arguments, got %zd"
,
name
,
(
min
==
max
?
""
:
"at least "
),
min
,
nargs
);
"%.200s expected %s%zd argument
%
s, got %zd"
,
name
,
(
min
==
max
?
""
:
"at least "
),
min
,
min
==
1
?
""
:
"s"
,
nargs
);
else
PyErr_Format
(
PyExc_TypeError
,
...
...
@@ -2430,8 +2430,8 @@ unpack_stack(PyObject *const *args, Py_ssize_t nargs, const char *name,
if
(
name
!=
NULL
)
PyErr_Format
(
PyExc_TypeError
,
"%.200s expected %s%zd arguments, got %zd"
,
name
,
(
min
==
max
?
""
:
"at most "
),
max
,
nargs
);
"%.200s expected %s%zd argument
%
s, got %zd"
,
name
,
(
min
==
max
?
""
:
"at most "
),
max
,
max
==
1
?
""
:
"s"
,
nargs
);
else
PyErr_Format
(
PyExc_TypeError
,
...
...
This diff is collapsed.
Click to expand it.
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