Skip to content

Commit 941919e

Browse files
committed
fix_homebrew_paths_in_standalone_zip.py: Remove a superfluous call to open()
1 parent 6b7857d commit 941919e

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

scripts/fix_homebrew_paths_in_standalone_zip.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,20 @@
4444
import sys
4545

4646
def readDependencies(fname):
47-
with open(fname) as f:
48-
with subprocess.Popen(['otool', '-L', fname], stdout=subprocess.PIPE) as o:
49-
for line in o.stdout:
50-
if line[0] == '\t':
51-
library = line.split(' ', 1)[0][1:]
52-
if (library.startswith("/usr/local/lib") or
53-
library.startswith("/usr/local/opt") or
54-
library.startswith("/Users/")):
55-
if (os.path.basename(library) != os.path.basename(fname)):
56-
command = "install_name_tool -change " + \
57-
library + " @executable_path/./" + \
58-
os.path.basename(library) + " " + fname
59-
print(command)
60-
os.system("chmod +w " + fname)
61-
os.system(command)
47+
with subprocess.Popen(['otool', '-L', fname], stdout=subprocess.PIPE) as o:
48+
for line in o.stdout:
49+
if line[0] == '\t':
50+
library = line.split(' ', 1)[0][1:]
51+
if (library.startswith("/usr/local/lib") or
52+
library.startswith("/usr/local/opt") or
53+
library.startswith("/Users/")):
54+
if (os.path.basename(library) != os.path.basename(fname)):
55+
command = "install_name_tool -change " + \
56+
library + " @executable_path/./" + \
57+
os.path.basename(library) + " " + fname
58+
print(command)
59+
os.system("chmod +w " + fname)
60+
os.system(command)
6261

6362
root = sys.argv[1]
6463
for (dirpath, dirnames, filenames) in os.walk(root):

0 commit comments

Comments
 (0)