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
dccfa13c
Kaydet (Commit)
dccfa13c
authored
Mar 27, 2014
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
inspect: Fix getcallargs() to fail correctly if more than 3 args are missing.
Patch by Jeremiah Lowin. Closes #20817.
üst
875df20e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
inspect.py
Lib/inspect.py
+1
-1
test_inspect.py
Lib/test/test_inspect.py
+6
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/inspect.py
Dosyayı görüntüle @
dccfa13c
...
@@ -1127,7 +1127,7 @@ def _missing_arguments(f_name, argnames, pos, values):
...
@@ -1127,7 +1127,7 @@ def _missing_arguments(f_name, argnames, pos, values):
elif
missing
==
2
:
elif
missing
==
2
:
s
=
"{} and {}"
.
format
(
*
names
)
s
=
"{} and {}"
.
format
(
*
names
)
else
:
else
:
tail
=
", {} and {}"
.
format
(
names
[
-
2
:])
tail
=
", {} and {}"
.
format
(
*
names
[
-
2
:])
del
names
[
-
2
:]
del
names
[
-
2
:]
s
=
", "
.
join
(
names
)
+
tail
s
=
", "
.
join
(
names
)
+
tail
raise
TypeError
(
"
%
s() missing
%
i required
%
s argument
%
s:
%
s"
%
raise
TypeError
(
"
%
s() missing
%
i required
%
s argument
%
s:
%
s"
%
...
...
Lib/test/test_inspect.py
Dosyayı görüntüle @
dccfa13c
...
@@ -1216,6 +1216,12 @@ class TestGetcallargsFunctions(unittest.TestCase):
...
@@ -1216,6 +1216,12 @@ class TestGetcallargsFunctions(unittest.TestCase):
inspect
.
getcallargs
(
f5
)
inspect
.
getcallargs
(
f5
)
# issue20817:
def
f6
(
a
,
b
,
c
):
pass
with
self
.
assertRaisesRegex
(
TypeError
,
"'a', 'b' and 'c'"
):
inspect
.
getcallargs
(
f6
)
class
TestGetcallargsMethods
(
TestGetcallargsFunctions
):
class
TestGetcallargsMethods
(
TestGetcallargsFunctions
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
dccfa13c
...
@@ -116,6 +116,9 @@ Library
...
@@ -116,6 +116,9 @@ Library
-
Issue
#
20816
:
Fix
inspect
.
getcallargs
()
to
raise
correct
TypeError
for
-
Issue
#
20816
:
Fix
inspect
.
getcallargs
()
to
raise
correct
TypeError
for
missing
keyword
-
only
arguments
.
Patch
by
Jeremiah
Lowin
.
missing
keyword
-
only
arguments
.
Patch
by
Jeremiah
Lowin
.
-
Issue
#
20817
:
Fix
inspect
.
getcallargs
()
to
fail
correctly
if
more
than
3
arguments
are
missing
.
Patch
by
Jeremiah
Lowin
.
Documentation
Documentation
-------------
-------------
...
...
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