]> granicus.if.org Git - python/commitdiff
bpo-32155: Bugfixes found by flake8 F841 warnings (#4619)
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 28 Nov 2017 22:04:12 +0000 (23:04 +0100)
committerGitHub <noreply@github.com>
Tue, 28 Nov 2017 22:04:12 +0000 (23:04 +0100)
* 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/turtledemo/__main__.py
Tools/scripts/treesync.py

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"',
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: