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
561d5aa4
Kaydet (Commit)
561d5aa4
authored
Şub 22, 2010
tarafından
Jack Diederich
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fixes issue #1522237, bad init check in _threading_local
üst
dc8c2ada
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
_threading_local.py
Lib/_threading_local.py
+1
-1
test_threading_local.py
Lib/test/test_threading_local.py
+15
-0
No files found.
Lib/_threading_local.py
Dosyayı görüntüle @
561d5aa4
...
...
@@ -154,7 +154,7 @@ class _localbase(object):
object
.
__setattr__
(
self
,
'_local__args'
,
(
args
,
kw
))
object
.
__setattr__
(
self
,
'_local__lock'
,
RLock
())
if
args
or
kw
and
(
cls
.
__init__
is
object
.
__init__
):
if
(
args
or
kw
)
and
(
cls
.
__init__
is
object
.
__init__
):
raise
TypeError
(
"Initialization arguments are not supported"
)
# We need to create the thread dict in anticipation of
...
...
Lib/test/test_threading_local.py
Dosyayı görüntüle @
561d5aa4
...
...
@@ -106,6 +106,21 @@ class ThreadingLocalTest(unittest.TestCase):
self
.
assertTrue
(
passed
)
def
test_arguments
(
self
):
# Issue 1522237
from
_thread
import
_local
as
local
from
_threading_local
import
local
as
py_local
for
cls
in
(
local
,
py_local
):
class
MyLocal
(
cls
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
pass
MyLocal
(
a
=
1
)
MyLocal
(
1
)
self
.
assertRaises
(
TypeError
,
cls
,
a
=
1
)
self
.
assertRaises
(
TypeError
,
cls
,
1
)
def
test_main
():
suite
=
unittest
.
TestSuite
()
...
...
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