Revert "Make license-map compatible to both python2 and python3"
The replacement is not equivalent and messes up the license output.
The actual asciidoctor warnings are only followup errors.
This reverts commit 49fa3930ac.
Bug: Issue 8417
Change-Id: I820b1d704ebd1c63d3822c0757d722d5c4305ced
This commit is contained in:
@@ -6,8 +6,8 @@ from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
from collections import defaultdict
|
||||
from shutil import copyfileobj
|
||||
from sys import stdout, stderr
|
||||
import os
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
|
||||
@@ -113,8 +113,8 @@ for n in sorted(graph.keys()):
|
||||
print()
|
||||
print("[[%s_license]]" % safename)
|
||||
print("----")
|
||||
with open(n[2:].replace(":", "/"), "rb") as input:
|
||||
os.write(stdout.fileno(), input.read(-1))
|
||||
with open(n[2:].replace(":", "/")) as fd:
|
||||
copyfileobj(fd, stdout)
|
||||
print()
|
||||
print("----")
|
||||
print()
|
||||
|
||||
@@ -25,7 +25,7 @@ def license_map(name, targets = [], opts = [], **kwargs):
|
||||
# post process the XML into our favorite format.
|
||||
native.genrule(
|
||||
name = "gen_license_txt_" + name,
|
||||
cmd = "python $(location //tools/bzl:license-map.py) %s %s > $@" % (" ".join(opts), " ".join(xmls)),
|
||||
cmd = "python2 $(location //tools/bzl:license-map.py) %s %s > $@" % (" ".join(opts), " ".join(xmls)),
|
||||
outs = [ name + ".txt" ],
|
||||
tools = tools,
|
||||
**kwargs
|
||||
|
||||
Reference in New Issue
Block a user