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
b452f41c
Kaydet (Commit)
b452f41c
authored
Nis 02, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #21526: Fixed support of new boolean type in Tcl 8.5.
üst
1399a01b
f7de3dd0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
6 deletions
+36
-6
test_tcl.py
Lib/test/test_tcl.py
+15
-0
NEWS
Misc/NEWS
+2
-2
_tkinter.c
Modules/_tkinter.c
+19
-4
No files found.
Lib/test/test_tcl.py
Dosyayı görüntüle @
b452f41c
...
...
@@ -378,6 +378,21 @@ class TclTest(unittest.TestCase):
if
tcl_version
>=
(
8
,
5
):
check
(
'2**64'
,
True
)
def
test_booleans
(
self
):
tcl
=
self
.
interp
def
check
(
expr
,
expected
):
result
=
tcl
.
call
(
'expr'
,
expr
)
self
.
assertEqual
(
result
,
expected
)
self
.
assertIsInstance
(
result
,
int
)
check
(
'true'
,
True
)
check
(
'yes'
,
True
)
check
(
'on'
,
True
)
check
(
'false'
,
False
)
check
(
'no'
,
False
)
check
(
'off'
,
False
)
check
(
'1 < 2'
,
True
)
check
(
'1 > 2'
,
False
)
def
test_passing_values
(
self
):
def
passValue
(
value
):
return
self
.
interp
.
call
(
'set'
,
'_'
,
value
)
...
...
Misc/NEWS
Dosyayı görüntüle @
b452f41c
...
...
@@ -16,6 +16,8 @@ Core and Builtins
Library
-------
- Issue #21526: Tkinter now supports new boolean type in Tcl 8.5.
- Issue #23836: Fix the faulthandler module to handle reentrant calls to
its signal handlers.
...
...
@@ -146,8 +148,6 @@ Library
- Issue #23252: Added support for writing ZIP files to unseekable streams.
- Issue #21526: Tkinter now supports new boolean type in Tcl 8.5.
- Issue #23647: Increase impalib'
s
MAXLINE
to
accommodate
modern
mailbox
sizes
.
-
Issue
#
23539
:
If
body
is
None
,
http
.
client
.
HTTPConnection
.
request
now
sets
...
...
Modules/_tkinter.c
Dosyayı görüntüle @
b452f41c
...
...
@@ -998,6 +998,15 @@ AsObj(PyObject *value)
}
}
static
PyObject
*
fromBoolean
(
PyObject
*
tkapp
,
Tcl_Obj
*
value
)
{
int
boolValue
;
if
(
Tcl_GetBooleanFromObj
(
Tkapp_Interp
(
tkapp
),
value
,
&
boolValue
)
==
TCL_ERROR
)
return
Tkinter_Error
(
tkapp
);
return
PyBool_FromLong
(
boolValue
);
}
static
PyObject
*
FromObj
(
PyObject
*
tkapp
,
Tcl_Obj
*
value
)
{
...
...
@@ -1011,10 +1020,7 @@ FromObj(PyObject* tkapp, Tcl_Obj *value)
if
(
value
->
typePtr
==
app
->
BooleanType
||
value
->
typePtr
==
app
->
OldBooleanType
)
{
int
boolValue
;
if
(
Tcl_GetBooleanFromObj
(
interp
,
value
,
&
boolValue
)
==
TCL_ERROR
)
return
Tkinter_Error
(
tkapp
);
return
PyBool_FromLong
(
boolValue
);
return
fromBoolean
(
tkapp
,
value
);
}
if
(
value
->
typePtr
==
app
->
ByteArrayType
)
{
...
...
@@ -1069,6 +1075,15 @@ FromObj(PyObject* tkapp, Tcl_Obj *value)
Tcl_GetCharLength
(
value
));
}
#if TK_VERSION_HEX >= 0x08050000
if
(
app
->
BooleanType
==
NULL
&&
strcmp
(
value
->
typePtr
->
name
,
"booleanString"
)
==
0
)
{
/* booleanString type is not registered in Tcl */
app
->
BooleanType
=
value
->
typePtr
;
return
fromBoolean
(
tkapp
,
value
);
}
#endif
return
newPyTclObject
(
value
);
}
...
...
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