Skip to content

Commit 5551a34

Browse files
committed
Convert utils/merge-rulesets.py to py3.6
1 parent 6c82452 commit 5551a34

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

make.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ do_not_ship="*.py *.xml"
5757
rm -f $do_not_ship
5858
cd ../..
5959

60-
python2.7 ./utils/merge-rulesets.py || exit 1
60+
python3.6 ./utils/merge-rulesets.py || exit 1
6161

6262
cp src/chrome/content/rules/default.rulesets pkg/crx/rules/default.rulesets
6363

utils/merge-rulesets.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2.7
1+
#!/usr/bin/env python3.6
22

33
# Merge all the .xml rulesets into a single "default.rulesets" file -- this
44
# prevents inodes from wasting disk space, but more importantly, this works
@@ -19,7 +19,7 @@ def normalize(f):
1919
OSX and Linux filesystems encode composite characters differently in
2020
filenames. We should normalize to NFC: http://unicode.org/reports/tr15/
2121
"""
22-
f = unicodedata.normalize("NFC", unicode(f, "utf-8")).encode("utf-8")
22+
f = unicodedata.normalize("NFC", f)
2323
return f
2424

2525
# commandline arguments parsing (nobody use it, though)
@@ -46,12 +46,12 @@ def normalize(f):
4646
for filename in sorted(files):
4747
tree = xml.etree.ElementTree.parse(filename)
4848
root = tree.getroot()
49-
49+
5050
ruleset = {}
5151

5252
for attr in root.attrib:
5353
ruleset[attr] = root.attrib[attr]
54-
54+
5555
for child in root:
5656
if child.tag in ["target", "rule", "securecookie", "exclusion"]:
5757
if child.tag not in ruleset:

0 commit comments

Comments
 (0)