Skip to content

Commit

Permalink
Revert "Make zip_plugin_files.py Python 3 compatible (bazelbuild/inte…
Browse files Browse the repository at this point in the history
…llij PR import bazelbuild#978)"

This reverts commit 30d5f1e.
  • Loading branch information
liucijus authored Aug 21, 2019
1 parent e9efde7 commit d295c46
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions build_defs/zip_plugin_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
import stat
import zipfile

# Keep this script executable from python2 in the host configuration.
# Python2's open() does not have the "encoding" parameter.
from io import open # pylint: disable=redefined-builtin,g-bad-import-order,g-importing-member

try:
from itertools import izip # pylint: disable=g-importing-member,g-import-not-at-top
except ImportError:
Expand All @@ -32,7 +28,7 @@ def main():
args = parser.parse_args()
with zipfile.ZipFile(args.output, "w") as outfile:
for exec_path, zip_path in pairwise(args.files_to_zip):
with open(exec_path, mode="rb") as input_file:
with open(exec_path) as input_file:
zipinfo = zipfile.ZipInfo(zip_path, (2000, 1, 1, 0, 0, 0))
filemode = stat.S_IMODE(os.fstat(input_file.fileno()).st_mode)
zipinfo.external_attr = filemode << 16
Expand Down

0 comments on commit d295c46

Please sign in to comment.