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
8d1da0f5
Commit
8d1da0f5
authored
Apr 01, 2010
by
Florent Xicluna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#7092: Fix some -3 warnings, and fix Lib/platform.py when the path contains a double-quote.
parent
b5023df3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
21 deletions
+22
-21
Lib/cgitb.py
Lib/cgitb.py
+4
-2
Lib/distutils/command/build_ext.py
Lib/distutils/command/build_ext.py
+1
-1
Lib/distutils/util.py
Lib/distutils/util.py
+1
-1
Lib/idlelib/AutoCompleteWindow.py
Lib/idlelib/AutoCompleteWindow.py
+2
-4
Lib/idlelib/MultiCall.py
Lib/idlelib/MultiCall.py
+10
-9
Lib/platform.py
Lib/platform.py
+4
-4
No files found.
Lib/cgitb.py
View file @
8d1da0f5
...
@@ -99,8 +99,9 @@ def scanvars(reader, frame, locals):
...
@@ -99,8 +99,9 @@ def scanvars(reader, frame, locals):
lasttoken
=
token
lasttoken
=
token
return
vars
return
vars
def
html
(
(
etype
,
evalue
,
etb
)
,
context
=
5
):
def
html
(
einfo
,
context
=
5
):
"""Return a nice HTML document describing a given traceback."""
"""Return a nice HTML document describing a given traceback."""
etype
,
evalue
,
etb
=
einfo
if
type
(
etype
)
is
types
.
ClassType
:
if
type
(
etype
)
is
types
.
ClassType
:
etype
=
etype
.
__name__
etype
=
etype
.
__name__
pyver
=
'Python '
+
sys
.
version
.
split
()[
0
]
+
': '
+
sys
.
executable
pyver
=
'Python '
+
sys
.
version
.
split
()[
0
]
+
': '
+
sys
.
executable
...
@@ -189,8 +190,9 @@ function calls leading up to the error, in the order they occurred.</p>'''
...
@@ -189,8 +190,9 @@ function calls leading up to the error, in the order they occurred.</p>'''
'''
%
pydoc
.
html
.
escape
(
'''
%
pydoc
.
html
.
escape
(
''
.
join
(
traceback
.
format_exception
(
etype
,
evalue
,
etb
)))
''
.
join
(
traceback
.
format_exception
(
etype
,
evalue
,
etb
)))
def
text
(
(
etype
,
evalue
,
etb
)
,
context
=
5
):
def
text
(
einfo
,
context
=
5
):
"""Return a plain text document describing a given traceback."""
"""Return a plain text document describing a given traceback."""
etype
,
evalue
,
etb
=
einfo
if
type
(
etype
)
is
types
.
ClassType
:
if
type
(
etype
)
is
types
.
ClassType
:
etype
=
etype
.
__name__
etype
=
etype
.
__name__
pyver
=
'Python '
+
sys
.
version
.
split
()[
0
]
+
': '
+
sys
.
executable
pyver
=
'Python '
+
sys
.
version
.
split
()[
0
]
+
': '
+
sys
.
executable
...
...
Lib/distutils/command/build_ext.py
View file @
8d1da0f5
...
@@ -676,7 +676,7 @@ class build_ext (Command):
...
@@ -676,7 +676,7 @@ class build_ext (Command):
# extensions in debug_mode are named 'module_d.pyd' under windows
# extensions in debug_mode are named 'module_d.pyd' under windows
so_ext
=
get_config_var
(
'SO'
)
so_ext
=
get_config_var
(
'SO'
)
if
os
.
name
==
'nt'
and
self
.
debug
:
if
os
.
name
==
'nt'
and
self
.
debug
:
return
apply
(
os
.
path
.
join
,
ext_path
)
+
'_d'
+
so_ext
return
os
.
path
.
join
(
*
ext_path
)
+
'_d'
+
so_ext
return
os
.
path
.
join
(
*
ext_path
)
+
so_ext
return
os
.
path
.
join
(
*
ext_path
)
+
so_ext
def
get_export_symbols
(
self
,
ext
):
def
get_export_symbols
(
self
,
ext
):
...
...
Lib/distutils/util.py
View file @
8d1da0f5
...
@@ -206,7 +206,7 @@ def convert_path (pathname):
...
@@ -206,7 +206,7 @@ def convert_path (pathname):
paths.remove('.')
paths.remove('.')
if not paths:
if not paths:
return os.curdir
return os.curdir
return
apply(os.path.join,
paths)
return
os.path.join(*
paths)
# convert_path ()
# convert_path ()
...
...
Lib/idlelib/AutoCompleteWindow.py
View file @
8d1da0f5
...
@@ -349,10 +349,8 @@ class AutoCompleteWindow:
...
@@ -349,10 +349,8 @@ class AutoCompleteWindow:
self
.
lastkey_was_tab
=
True
self
.
lastkey_was_tab
=
True
return
return
elif
reduce
(
lambda
x
,
y
:
x
or
y
,
elif
any
(
s
in
keysym
for
s
in
(
"Shift"
,
"Control"
,
"Alt"
,
[
keysym
.
find
(
s
)
!=
-
1
for
s
in
(
"Shift"
,
"Control"
,
"Alt"
,
"Meta"
,
"Command"
,
"Option"
)):
"Meta"
,
"Command"
,
"Option"
)
]):
# A modifier key, so ignore
# A modifier key, so ignore
return
return
...
...
Lib/idlelib/MultiCall.py
View file @
8d1da0f5
...
@@ -107,10 +107,9 @@ class _SimpleBinder:
...
@@ -107,10 +107,9 @@ class _SimpleBinder:
# a list of the states which are a subset of it. This list is ordered by the
# a list of the states which are a subset of it. This list is ordered by the
# number of modifiers is the state - the most specific state comes first.
# number of modifiers is the state - the most specific state comes first.
_states
=
range
(
1
<<
len
(
_modifiers
))
_states
=
range
(
1
<<
len
(
_modifiers
))
_state_names
=
[
reduce
(
lambda
x
,
y
:
x
+
y
,
_state_names
=
[
''
.
join
(
m
[
0
]
+
'-'
[
_modifiers
[
i
][
0
]
+
'-'
for
i
in
range
(
len
(
_modifiers
))
for
i
,
m
in
enumerate
(
_modifiers
)
if
(
1
<<
i
)
&
s
],
if
(
1
<<
i
)
&
s
)
""
)
for
s
in
_states
]
for
s
in
_states
]
_state_subsets
=
map
(
lambda
i
:
filter
(
lambda
j
:
not
(
j
&
(
~
i
)),
_states
),
_state_subsets
=
map
(
lambda
i
:
filter
(
lambda
j
:
not
(
j
&
(
~
i
)),
_states
),
_states
)
_states
)
...
@@ -119,11 +118,13 @@ for l in _state_subsets:
...
@@ -119,11 +118,13 @@ for l in _state_subsets:
range
(
len
(
_modifiers
)))):
range
(
len
(
_modifiers
)))):
nummod
(
b
)
-
nummod
(
a
))
nummod
(
b
)
-
nummod
(
a
))
# _state_codes gives for each state, the portable code to be passed as mc_state
# _state_codes gives for each state, the portable code to be passed as mc_state
_state_codes
=
[
reduce
(
lambda
x
,
y
:
x
|
y
,
_state_codes
=
[]
[
_modifier_masks
[
i
]
for
i
in
range
(
len
(
_modifiers
))
for
s
in
_states
:
if
(
1
<<
i
)
&
s
],
r
=
0
0
)
for
i
in
range
(
len
(
_modifiers
)):
for
s
in
_states
]
if
(
1
<<
i
)
&
s
:
r
|=
_modifier_masks
[
i
]
_state_codes
.
append
(
r
)
class
_ComplexBinder
:
class
_ComplexBinder
:
# This class binds many functions, and only unbinds them when it is deleted.
# This class binds many functions, and only unbinds them when it is deleted.
...
...
Lib/platform.py
View file @
8d1da0f5
...
@@ -966,7 +966,7 @@ def _syscmd_file(target,default=''):
...
@@ -966,7 +966,7 @@ def _syscmd_file(target,default=''):
if
sys
.
platform
in
(
'dos'
,
'win32'
,
'win16'
,
'os2'
):
if
sys
.
platform
in
(
'dos'
,
'win32'
,
'win16'
,
'os2'
):
# XXX Others too ?
# XXX Others too ?
return
default
return
default
target
=
_follow_symlinks
(
target
)
target
=
_follow_symlinks
(
target
)
.
replace
(
'"'
,
'
\
\
"'
)
try
:
try
:
f
=
os
.
popen
(
'file "%s" 2> %s'
%
(
target
,
DEV_NULL
))
f
=
os
.
popen
(
'file "%s" 2> %s'
%
(
target
,
DEV_NULL
))
except
(
AttributeError
,
os
.
error
):
except
(
AttributeError
,
os
.
error
):
...
@@ -1032,13 +1032,13 @@ def architecture(executable=sys.executable,bits='',linkage=''):
...
@@ -1032,13 +1032,13 @@ def architecture(executable=sys.executable,bits='',linkage=''):
executable == sys.executable:
executable == sys.executable:
# "file" command did not return anything; we'll try to provide
# "file" command did not return anything; we'll try to provide
# some sensible defaults then...
# some sensible defaults then...
if
_default_architecture.has_key(sys.platform)
:
if
sys.platform in _default_architecture
:
b,l = _default_architecture[sys.platform]
b,
l = _default_architecture[sys.platform]
if b:
if b:
bits = b
bits = b
if l:
if l:
linkage = l
linkage = l
return bits,linkage
return bits,
linkage
# Split the output into a list of strings omitting the filename
# Split the output into a list of strings omitting the filename
fileout = _architecture_split(output)[1:]
fileout = _architecture_split(output)[1:]
...
...
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