2020# cleanup after bugs :/
2121misfile = rulesets_fn + "r"
2222if os .path .exists (misfile ):
23- print "Cleaning up malformed rulesets file..."
23+ print ( "Cleaning up malformed rulesets file..." )
2424 os .unlink (misfile )
2525
26- print "Creating ruleset library..."
26+ print ( "Creating ruleset library..." )
2727
2828# Under git bash, sed -i issues errors and sets the file "read only". Thanks.
2929if os .path .isfile (rulesets_fn ):
5050library .write ("</rulesetlibrary>\n " )
5151library .close ()
5252
53- print "Removing whitespaces and comments..."
53+ print ( "Removing whitespaces and comments..." )
5454
5555def rulesize ():
5656 return len (open (rulesets_fn ).read ())
@@ -60,18 +60,18 @@ def rulesize():
6060call (sedcmd + [r"s/<!--.*?-->//g;/<!--/N;//ba" , rulesets_fn ])
6161call (["sed" , "-i" , r":a;N;$!ba;s/\n//g;s/>[ ]*</></g;s/[ ]*to=/ to=/g;s/[ ]*from=/ from=/g;s/ \/>/\/>/g" , rulesets_fn ])
6262call (["sed" , "-i" , r"s/<\/ruleset>/<\/ruleset>\n/g" , rulesets_fn ])
63- print "Crushed" , crush , "bytes of rulesets into" , rulesize ()
63+ print (( "Crushed" , crush , "bytes of rulesets into" , rulesize ()) )
6464
6565try :
6666 if 0 == call (["xmllint" , "--noout" , rulesets_fn ]):
67- print rulesets_fn , "passed XML validity test."
67+ print (( rulesets_fn , "passed XML validity test." ))
6868 else :
69- print "ERROR:" , rulesets_fn , "failed XML validity test!"
69+ print (( "ERROR:" , rulesets_fn , "failed XML validity test!" ))
7070 sys .exit (1 )
71- except OSError , e :
71+ except OSError as e :
7272 if "No such file or directory" not in traceback .format_exc ():
7373 raise
74- print "WARNING: xmllint not present; validation of" , rulesets_fn , " skipped."
74+ print (( "WARNING: xmllint not present; validation of" , rulesets_fn , " skipped." ))
7575
7676# We make default.rulesets at build time, but it shouldn't have a variable
7777# timestamp
0 commit comments