Skip to content

Commit 696b501

Browse files
authored
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".
1 parent 4271dfd commit 696b501

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

Lib/distutils/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def _read_pypirc(self):
7777
# optional params
7878
for key, default in (('repository',
7979
self.DEFAULT_REPOSITORY),
80-
('realm', self.DEFAULT_REALM),
80+
('realm', realm),
8181
('password', None)):
8282
if config.has_option(server, key):
8383
current[key] = config.get(server, key)
@@ -106,7 +106,7 @@ def _read_pypirc(self):
106106
'password': config.get(server, 'password'),
107107
'repository': repository,
108108
'server': server,
109-
'realm': self.DEFAULT_REALM}
109+
'realm': realm}
110110

111111
return {}
112112

Lib/turtledemo/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def __init__(self, filename=None):
136136
import subprocess
137137
# Make sure we are the currently activated OS X application
138138
# so that our menu bar appears.
139-
p = subprocess.Popen(
139+
subprocess.run(
140140
[
141141
'osascript',
142142
'-e', 'tell application "System Events"',
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix distutils.config: use the PyPIRCCommand.realm attribute if it is set.

Tools/scripts/treesync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
write_master = "ask"
3434

3535
def main():
36-
global always_no, always_yes
36+
global default_answer, always_no, always_yes, create_files
3737
global create_directories, write_master, write_slave
3838
opts, args = getopt.getopt(sys.argv[1:], "nym:s:d:f:a:")
3939
for o, a in opts:

0 commit comments

Comments
 (0)