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:
David Ostrovsky 2018-02-28 20:58:12 +01:00
parent d14334fe2d
commit 01fbe50f3a
2 changed files with 4 additions and 4 deletions

View File

@ -6,8 +6,8 @@ from __future__ import print_function
import argparse import argparse
from collections import defaultdict from collections import defaultdict
from shutil import copyfileobj
from sys import stdout, stderr from sys import stdout, stderr
import os
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
@ -113,8 +113,8 @@ for n in sorted(graph.keys()):
print() print()
print("[[%s_license]]" % safename) print("[[%s_license]]" % safename)
print("----") print("----")
with open(n[2:].replace(":", "/"), "rb") as input: with open(n[2:].replace(":", "/")) as fd:
os.write(stdout.fileno(), input.read(-1)) copyfileobj(fd, stdout)
print() print()
print("----") print("----")
print() print()

View File

@ -25,7 +25,7 @@ def license_map(name, targets = [], opts = [], **kwargs):
# post process the XML into our favorite format. # post process the XML into our favorite format.
native.genrule( native.genrule(
name = "gen_license_txt_" + name, 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" ], outs = [ name + ".txt" ],
tools = tools, tools = tools,
**kwargs **kwargs