diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-11-28 15:30:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-28 15:30:32 +0100 |
commit | 696b501cd11dc429a0f661adeb598bfaf89e4112 (patch) | |
tree | b289e99f2857c2b129aa276f4647fecdcd67feff | |
parent | 4271dfd7815c05fd39b515c240050b3585bdfcd4 (diff) | |
download | cpython-git-696b501cd11dc429a0f661adeb598bfaf89e4112.tar.gz |
bpo-32155: Bugfixes found by flake8 F841 warnings (#4608)
* distutils.config: Use the PyPIRCCommand.realm attribute if set
* turtledemo: wait until macOS osascript command completes to not
create a zombie process
* Tools/scripts/treesync.py: declare 'default_answer' and
'create_files' as globals to modify them with the command line
arguments. Previously, -y, -n, -f and -a options had no effect.
flake8 warning: "F841 local variable 'p' is assigned to but never
used".
-rw-r--r-- | Lib/distutils/config.py | 4 | ||||
-rw-r--r-- | Lib/turtledemo/__main__.py | 2 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Library/2017-11-28-15-06-07.bpo-32155.hWHGww.rst | 1 | ||||
-rwxr-xr-x | Tools/scripts/treesync.py | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/Lib/distutils/config.py b/Lib/distutils/config.py index bf8d8dd2f5..e66d103f7d 100644 --- a/Lib/distutils/config.py +++ b/Lib/distutils/config.py @@ -77,7 +77,7 @@ class PyPIRCCommand(Command): # optional params for key, default in (('repository', self.DEFAULT_REPOSITORY), - ('realm', self.DEFAULT_REALM), + ('realm', realm), ('password', None)): if config.has_option(server, key): current[key] = config.get(server, key) @@ -106,7 +106,7 @@ class PyPIRCCommand(Command): 'password': config.get(server, 'password'), 'repository': repository, 'server': server, - 'realm': self.DEFAULT_REALM} + 'realm': realm} return {} diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py index 0a58332a66..6daf694427 100644 --- a/Lib/turtledemo/__main__.py +++ b/Lib/turtledemo/__main__.py @@ -136,7 +136,7 @@ class DemoWindow(object): import subprocess # Make sure we are the currently activated OS X application # so that our menu bar appears. - p = subprocess.Popen( + subprocess.run( [ 'osascript', '-e', 'tell application "System Events"', diff --git a/Misc/NEWS.d/next/Library/2017-11-28-15-06-07.bpo-32155.hWHGww.rst b/Misc/NEWS.d/next/Library/2017-11-28-15-06-07.bpo-32155.hWHGww.rst new file mode 100644 index 0000000000..a9509b546a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2017-11-28-15-06-07.bpo-32155.hWHGww.rst @@ -0,0 +1 @@ +Fix distutils.config: use the PyPIRCCommand.realm attribute if it is set. diff --git a/Tools/scripts/treesync.py b/Tools/scripts/treesync.py index 652d3940a4..215e2bd4e5 100755 --- a/Tools/scripts/treesync.py +++ b/Tools/scripts/treesync.py @@ -33,7 +33,7 @@ write_slave = "ask" write_master = "ask" def main(): - global always_no, always_yes + global default_answer, always_no, always_yes, create_files global create_directories, write_master, write_slave opts, args = getopt.getopt(sys.argv[1:], "nym:s:d:f:a:") for o, a in opts: |