Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
950e6ac2
Commit
950e6ac2
authored
Feb 12, 2004
by
Walter Dörwald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace backticks with repr() or "%r"
From SF patch #852334.
parent
cdd1c764
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
15 deletions
+15
-15
cmd.py
cmd.py
+2
-2
core.py
core.py
+1
-1
dir_util.py
dir_util.py
+1
-1
dist.py
dist.py
+2
-2
fancy_getopt.py
fancy_getopt.py
+1
-1
util.py
util.py
+8
-8
No files found.
cmd.py
View file @
950e6ac2
...
...
@@ -253,8 +253,8 @@ class Command:
if
not
ok
:
raise
DistutilsOptionError
,
\
"'%s' must be a list of strings (got %
s
)"
%
\
(
option
,
`val`
)
"'%s' must be a list of strings (got %
r
)"
%
\
(
option
,
val
)
def
_ensure_tested_string
(
self
,
option
,
tester
,
what
,
error_fmt
,
default
=
None
):
...
...
core.py
View file @
950e6ac2
...
...
@@ -202,7 +202,7 @@ def run_setup (script_name, script_args=None, stop_after="run"):
used to drive the Distutils.
"""
if
stop_after
not
in
(
'init'
,
'config'
,
'commandline'
,
'run'
):
raise
ValueError
,
"invalid value for 'stop_after': %
s"
%
`stop_after`
raise
ValueError
,
"invalid value for 'stop_after': %
r"
%
(
stop_after
,)
global
_setup_stop_after
,
_setup_distribution
_setup_stop_after
=
stop_after
...
...
dir_util.py
View file @
950e6ac2
...
...
@@ -33,7 +33,7 @@ def mkpath (name, mode=0777, verbose=0, dry_run=0):
# Detect a common bug -- name is None
if
type
(
name
)
is
not
StringType
:
raise
DistutilsInternalError
,
\
"mkpath: 'name' must be a string (got %
s)"
%
`name`
"mkpath: 'name' must be a string (got %
r)"
%
(
name
,)
# XXX what's the better way to handle verbosity? print as we create
# each directory in the path (the current behaviour), or only announce
...
...
dist.py
View file @
950e6ac2
...
...
@@ -525,9 +525,9 @@ class Distribution:
func
()
else
:
raise
DistutilsClassError
(
"invalid help function %
s
for help option '%s': "
"invalid help function %
r
for help option '%s': "
"must be a callable object (function, etc.)"
%
(
`func`
,
help_option
))
%
(
func
,
help_option
))
if
help_option_found
:
return
...
...
fancy_getopt.py
View file @
950e6ac2
...
...
@@ -162,7 +162,7 @@ class FancyGetopt:
else
:
# the option table is part of the code, so simply
# assert that it is correct
assert
"invalid option tuple: %
s"
%
`option`
assert
"invalid option tuple: %
r"
%
(
option
,)
# Type- and value-check the option names
if
type
(
long
)
is
not
StringType
or
len
(
long
)
<
2
:
...
...
util.py
View file @
950e6ac2
...
...
@@ -285,7 +285,7 @@ def execute (func, args, msg=None, verbose=0, dry_run=0):
print
.
"""
if msg is None:
msg = "%s%
s" % (func.__name__, `args`
)
msg = "%s%
r" % (func.__name__, args
)
if msg[-2:] == ',)': # correct for singleton tuple
msg = msg[0:-2] + ')'
...
...
@@ -307,7 +307,7 @@ def strtobool (val):
elif val in ('n', 'no', 'f', 'false', 'off', '0'):
return 0
else:
raise ValueError, "invalid truth value %
s" % `val`
raise ValueError, "invalid truth value %
r" % (val,)
def byte_compile (py_files,
...
...
@@ -394,11 +394,11 @@ files = [
script.write(string.join(map(repr, py_files), ",
\
n
") + "]
\
n
")
script.write("""
byte_compile
(
files
,
optimize
=%
s
,
force
=%
s
,
prefix
=%
s
,
base_dir
=%
s
,
verbose
=%
s
,
dry_run
=
0
,
byte_compile
(
files
,
optimize
=%
r
,
force
=%
r
,
prefix
=%
r
,
base_dir
=%
r
,
verbose
=%
r
,
dry_run
=
0
,
direct
=
1
)
""" % (
`optimize`, `force`, `prefix`, `base_dir`, `verbose`
))
""" % (
optimize, force, prefix, base_dir, verbose
))
script.close()
...
...
@@ -432,8 +432,8 @@ byte_compile(files, optimize=%s, force=%s,
if prefix:
if file[:len(prefix)] != prefix:
raise ValueError,
\
("invalid prefix: filename %
s doesn't start with %s
"
% (
`file`, `prefix`
))
("invalid prefix: filename %
r doesn't start with %r
"
% (
file, prefix
))
dfile = dfile[len(prefix):]
if base_dir:
dfile = os.path.join(base_dir, dfile)
...
...
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