Buck: Remove Python 2.6 compatibility workarounds
The check_output method is only available from Python 2.7, so a wrapper method was introduced for compatibility with 2.6. The ZipFile class does not include context manager support in Python 2.6, so the file download code was written to explicitly open and close the zip files. Since Buck itself now requires at least Python 2.7, these workarounds are no longer necessary. Remove them. Also, tidy up a few minor PEP-8 coding style violations in the modified files. Change-Id: I9a1b25ddf7494e25ccadeaed0c1d85cd1ce2fd09
This commit is contained in:
@@ -16,9 +16,8 @@
|
||||
from __future__ import print_function
|
||||
from optparse import OptionParser
|
||||
from os import getcwd, chdir, makedirs, path, symlink
|
||||
from subprocess import check_call
|
||||
from subprocess import check_call, check_output
|
||||
import sys
|
||||
from util import check_output
|
||||
|
||||
opts = OptionParser()
|
||||
opts.add_option('-o', help='path to write WAR to')
|
||||
@@ -31,6 +30,7 @@ war = args.tmp
|
||||
root = war[:war.index('buck-out')]
|
||||
jars = set()
|
||||
|
||||
|
||||
def link_jars(libs, directory):
|
||||
makedirs(directory)
|
||||
while not path.isfile('.buckconfig'):
|
||||
@@ -51,7 +51,7 @@ if args.pgmlib:
|
||||
try:
|
||||
for s in ctx:
|
||||
check_call(['unzip', '-q', '-d', war, s])
|
||||
check_call(['zip', '-9qr', args.o, '.'], cwd = war)
|
||||
check_call(['zip', '-9qr', args.o, '.'], cwd=war)
|
||||
except KeyboardInterrupt:
|
||||
print('Interrupted by user', file=sys.stderr)
|
||||
exit(1)
|
||||
|
||||
Reference in New Issue
Block a user