Skip to content

Commit 96c719b

Browse files
committed
Convert filename validation to py3.6
1 parent 9885526 commit 96c719b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/validations.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ utils/remove-obsolete-references.sh
55
test/validations/path/run.sh
66
test/validations/test-coverage/run.sh
77
python3.6 test/validations/securecookie/run.py
8-
python2.7 test/validations/filename/run.py
8+
python3.6 test/validations/filename/run.py
99
python2.7 test/validations/relaxng/run.py
1010
python2.7 test/validations/special/run.py --quiet

test/validations/filename/run.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#!/usr/bin/env python2.7
2-
#
1+
#!/usr/bin/env python3.6
2+
#
33
# Validates and provides a generator for ruleset filenames
44
#
55

@@ -18,7 +18,7 @@ def validate_filenames():
1818
most_common_entry = counted_lowercase_names.most_common(1)[0]
1919
if most_common_entry[1] > 1:
2020
dupe_filename = re.compile(re.escape(most_common_entry[0]), re.IGNORECASE)
21-
print("%s failed case-insensitivity testing." % filter(dupe_filename.match, filenames))
21+
print("{} failed case-insensitivity testing.".format(list(filter(dupe_filename.match, filenames))))
2222
print("Rules exist with identical case-insensitive names, which breaks some filesystems.")
2323
sys.exit(1)
2424

@@ -28,10 +28,10 @@ def validate_filenames():
2828
continue
2929

3030
if " " in fi:
31-
print("%s failed validity: Rule filenames cannot contain spaces" % (fi))
31+
print("{} failed validity: Rule filenames cannot contain spaces".format(fi))
3232
sys.exit(1)
3333
if not fi.endswith('.xml'):
34-
print("%s failed validity: Rule filenames must end in .xml" % (fi))
34+
print("{} failed validity: Rule filenames must end in .xml".format(fi))
3535
sys.exit(1)
3636

3737
yield fi

0 commit comments

Comments
 (0)