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
d6bfa944
Kaydet (Commit)
d6bfa944
authored
May 31, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #21853: Fixed the inspect module in unicode disabled build.
üst
59ea508b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
inspect.py
Lib/inspect.py
+7
-2
test_inspect.py
Lib/test/test_inspect.py
+7
-3
No files found.
Lib/inspect.py
Dosyayı görüntüle @
d6bfa944
...
@@ -969,8 +969,13 @@ def getcallargs(func, *positional, **named):
...
@@ -969,8 +969,13 @@ def getcallargs(func, *positional, **named):
assign
(
varkw
,
named
)
assign
(
varkw
,
named
)
elif
named
:
elif
named
:
unexpected
=
next
(
iter
(
named
))
unexpected
=
next
(
iter
(
named
))
if
isinstance
(
unexpected
,
unicode
):
try
:
unexpected
=
unexpected
.
encode
(
sys
.
getdefaultencoding
(),
'replace'
)
unicode
except
NameError
:
pass
else
:
if
isinstance
(
unexpected
,
unicode
):
unexpected
=
unexpected
.
encode
(
sys
.
getdefaultencoding
(),
'replace'
)
raise
TypeError
(
"
%
s() got an unexpected keyword argument '
%
s'"
%
raise
TypeError
(
"
%
s() got an unexpected keyword argument '
%
s'"
%
(
f_name
,
unexpected
))
(
f_name
,
unexpected
))
unassigned
=
num_args
-
len
([
arg
for
arg
in
args
if
is_assigned
(
arg
)])
unassigned
=
num_args
-
len
([
arg
for
arg
in
args
if
is_assigned
(
arg
)])
...
...
Lib/test/test_inspect.py
Dosyayı görüntüle @
d6bfa944
...
@@ -8,7 +8,7 @@ import datetime
...
@@ -8,7 +8,7 @@ import datetime
from
UserList
import
UserList
from
UserList
import
UserList
from
UserDict
import
UserDict
from
UserDict
import
UserDict
from
test.test_support
import
run_unittest
,
check_py3k_warnings
from
test.test_support
import
run_unittest
,
check_py3k_warnings
,
have_unicode
with
check_py3k_warnings
(
with
check_py3k_warnings
(
(
"tuple parameter unpacking has been removed"
,
SyntaxWarning
),
(
"tuple parameter unpacking has been removed"
,
SyntaxWarning
),
...
@@ -17,7 +17,10 @@ with check_py3k_warnings(
...
@@ -17,7 +17,10 @@ with check_py3k_warnings(
from
test
import
inspect_fodder2
as
mod2
from
test
import
inspect_fodder2
as
mod2
# C module for test_findsource_binary
# C module for test_findsource_binary
import
unicodedata
try
:
import
unicodedata
except
ImportError
:
unicodedata
=
None
# Functions tested in this suite:
# Functions tested in this suite:
# ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode,
# ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode,
...
@@ -798,7 +801,8 @@ class TestGetcallargsFunctions(unittest.TestCase):
...
@@ -798,7 +801,8 @@ class TestGetcallargsFunctions(unittest.TestCase):
self
.
assertEqualException
(
f
,
'2, c=3'
)
self
.
assertEqualException
(
f
,
'2, c=3'
)
self
.
assertEqualException
(
f
,
'2, 3, c=4'
)
self
.
assertEqualException
(
f
,
'2, 3, c=4'
)
self
.
assertEqualException
(
f
,
'2, c=4, b=3'
)
self
.
assertEqualException
(
f
,
'2, c=4, b=3'
)
self
.
assertEqualException
(
f
,
'**{u"
\u03c0\u03b9
": 4}'
)
if
have_unicode
:
self
.
assertEqualException
(
f
,
'**{u"
\u03c0\u03b9
": 4}'
)
# f got multiple values for keyword argument
# f got multiple values for keyword argument
self
.
assertEqualException
(
f
,
'1, a=2'
)
self
.
assertEqualException
(
f
,
'1, a=2'
)
self
.
assertEqualException
(
f
,
'1, **{"a":2}'
)
self
.
assertEqualException
(
f
,
'1, **{"a":2}'
)
...
...
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