]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-32155: Bugfixes found by flake8 F841 warnings (#4608)
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 28 Nov 2017 14:30:32 +0000 (15:30 +0100)
committerGitHub <noreply@github.com>
Tue, 28 Nov 2017 14:30:32 +0000 (15:30 +0100)
* 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".

Lib/distutils/config.py
Lib/turtledemo/__main__.py
Misc/NEWS.d/next/Library/2017-11-28-15-06-07.bpo-32155.hWHGww.rst [new file with mode: 0644]
Tools/scripts/treesync.py

index bf8d8dd2f5a43e0fc2efb440638bb9eff05938c9..e66d103f7d12f7027469cf71953de8c99d667ada 100644 (file)
@@ -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 {}
 
index 0a58332a6664007ff111e0008c49b80619872f8e..6daf694427d4cfe6dfef6898204722cf7ec7b2dd 100644 (file)
@@ -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 (file)
index 0000000..a9509b5
--- /dev/null
@@ -0,0 +1 @@
+Fix distutils.config: use the PyPIRCCommand.realm attribute if it is set.
index 652d3940a49a403f26719d5d4529376b4600a59e..215e2bd4e54261302b8514b432aab8658acf03a4 100755 (executable)
@@ -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: