Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7e9394ab
Commit
7e9394ab
authored
Mar 17, 1995
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add TkVersion,TclVersion; don't drop in debugger
parent
470be14c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
84 deletions
+40
-84
Lib/lib-tk/Tkinter.py
Lib/lib-tk/Tkinter.py
+20
-42
Lib/tkinter/Tkinter.py
Lib/tkinter/Tkinter.py
+20
-42
No files found.
Lib/lib-tk/Tkinter.py
View file @
7e9394ab
...
@@ -2,22 +2,20 @@
...
@@ -2,22 +2,20 @@
import
tkinter
import
tkinter
from
tkinter
import
TclError
from
tkinter
import
TclError
from
types
import
*
CallableTypes
=
(
FunctionType
,
MethodType
,
BuiltinFunctionType
,
BuiltinMethodType
,
ClassType
,
InstanceType
)
class
_Dummy
:
# Older versions of tkinter don't define these variables
def
meth
(
self
):
return
try
:
TkVersion
=
eval
(
tkinter
.
TK_VERSION
)
def
_func
():
except
AttributeError
:
pass
TkVersion
=
3.6
try
:
FunctionType
=
type
(
_func
)
TclVersion
=
eval
(
tkinter
.
TCL_VERSION
)
ClassType
=
type
(
_Dummy
)
except
AttributeError
:
MethodType
=
type
(
_Dummy
.
meth
)
TclVersion
=
7.3
StringType
=
type
(
''
)
TupleType
=
type
(())
ListType
=
type
([])
DictionaryType
=
type
({})
NoneType
=
type
(
None
)
CallableTypes
=
(
FunctionType
,
MethodType
)
def
_flatten
(
tuple
):
def
_flatten
(
tuple
):
res
=
()
res
=
()
...
@@ -347,10 +345,10 @@ class Misc:
...
@@ -347,10 +345,10 @@ class Misc:
self
.
tk
.
quit
()
self
.
tk
.
quit
()
def
_getints
(
self
,
string
):
def
_getints
(
self
,
string
):
if
not
string
:
return
None
if
not
string
:
return
None
re
s
=
(
)
re
turn
tuple
(
map
(
self
.
tk
.
getint
,
self
.
tk
.
splitlist
(
string
))
)
for
v
in
self
.
tk
.
splitlist
(
string
):
def
_getdoubles
(
self
,
string
):
res
=
res
+
(
self
.
tk
.
getint
(
v
),)
if
not
string
:
return
None
return
res
return
tuple
(
map
(
self
.
tk
.
getdouble
,
self
.
tk
.
splitlist
(
string
)))
def
_getboolean
(
self
,
string
):
def
_getboolean
(
self
,
string
):
if
string
:
if
string
:
return
self
.
tk
.
getboolean
(
string
)
return
self
.
tk
.
getboolean
(
string
)
...
@@ -438,29 +436,9 @@ class _CallSafely:
...
@@ -438,29 +436,9 @@ class _CallSafely:
except
SystemExit
,
msg
:
except
SystemExit
,
msg
:
raise
SystemExit
,
msg
raise
SystemExit
,
msg
except
:
except
:
try
:
import
traceback
try
:
print
"Exception in Tkinter callback"
t
=
sys
.
exc_traceback
traceback
.
print_exc
()
while
t
:
sys
.
stderr
.
write
(
' %s, line %s
\
n
'
%
(
t
.
tb_frame
.
f_code
,
t
.
tb_lineno
))
t
=
t
.
tb_next
finally
:
sys
.
stderr
.
write
(
'%s: %s
\
n
'
%
(
sys
.
exc_type
,
sys
.
exc_value
))
(
sys
.
last_type
,
sys
.
last_value
,
sys
.
last_traceback
)
=
(
sys
.
exc_type
,
sys
.
exc_value
,
sys
.
exc_traceback
)
import
pdb
pdb
.
pm
()
except
:
print
'*** Error in error handling ***'
print
sys
.
exc_type
,
':'
,
sys
.
exc_value
class
Wm
:
class
Wm
:
def
aspect
(
self
,
def
aspect
(
self
,
...
...
Lib/tkinter/Tkinter.py
View file @
7e9394ab
...
@@ -2,22 +2,20 @@
...
@@ -2,22 +2,20 @@
import
tkinter
import
tkinter
from
tkinter
import
TclError
from
tkinter
import
TclError
from
types
import
*
CallableTypes
=
(
FunctionType
,
MethodType
,
BuiltinFunctionType
,
BuiltinMethodType
,
ClassType
,
InstanceType
)
class
_Dummy
:
# Older versions of tkinter don't define these variables
def
meth
(
self
):
return
try
:
TkVersion
=
eval
(
tkinter
.
TK_VERSION
)
def
_func
():
except
AttributeError
:
pass
TkVersion
=
3.6
try
:
FunctionType
=
type
(
_func
)
TclVersion
=
eval
(
tkinter
.
TCL_VERSION
)
ClassType
=
type
(
_Dummy
)
except
AttributeError
:
MethodType
=
type
(
_Dummy
.
meth
)
TclVersion
=
7.3
StringType
=
type
(
''
)
TupleType
=
type
(())
ListType
=
type
([])
DictionaryType
=
type
({})
NoneType
=
type
(
None
)
CallableTypes
=
(
FunctionType
,
MethodType
)
def
_flatten
(
tuple
):
def
_flatten
(
tuple
):
res
=
()
res
=
()
...
@@ -347,10 +345,10 @@ class Misc:
...
@@ -347,10 +345,10 @@ class Misc:
self
.
tk
.
quit
()
self
.
tk
.
quit
()
def
_getints
(
self
,
string
):
def
_getints
(
self
,
string
):
if
not
string
:
return
None
if
not
string
:
return
None
re
s
=
(
)
re
turn
tuple
(
map
(
self
.
tk
.
getint
,
self
.
tk
.
splitlist
(
string
))
)
for
v
in
self
.
tk
.
splitlist
(
string
):
def
_getdoubles
(
self
,
string
):
res
=
res
+
(
self
.
tk
.
getint
(
v
),)
if
not
string
:
return
None
return
res
return
tuple
(
map
(
self
.
tk
.
getdouble
,
self
.
tk
.
splitlist
(
string
)))
def
_getboolean
(
self
,
string
):
def
_getboolean
(
self
,
string
):
if
string
:
if
string
:
return
self
.
tk
.
getboolean
(
string
)
return
self
.
tk
.
getboolean
(
string
)
...
@@ -438,29 +436,9 @@ class _CallSafely:
...
@@ -438,29 +436,9 @@ class _CallSafely:
except
SystemExit
,
msg
:
except
SystemExit
,
msg
:
raise
SystemExit
,
msg
raise
SystemExit
,
msg
except
:
except
:
try
:
import
traceback
try
:
print
"Exception in Tkinter callback"
t
=
sys
.
exc_traceback
traceback
.
print_exc
()
while
t
:
sys
.
stderr
.
write
(
' %s, line %s
\
n
'
%
(
t
.
tb_frame
.
f_code
,
t
.
tb_lineno
))
t
=
t
.
tb_next
finally
:
sys
.
stderr
.
write
(
'%s: %s
\
n
'
%
(
sys
.
exc_type
,
sys
.
exc_value
))
(
sys
.
last_type
,
sys
.
last_value
,
sys
.
last_traceback
)
=
(
sys
.
exc_type
,
sys
.
exc_value
,
sys
.
exc_traceback
)
import
pdb
pdb
.
pm
()
except
:
print
'*** Error in error handling ***'
print
sys
.
exc_type
,
':'
,
sys
.
exc_value
class
Wm
:
class
Wm
:
def
aspect
(
self
,
def
aspect
(
self
,
...
...
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