diff -r 1cb8f7566a07 -r cb4a7f8b230d yml2proc --- a/yml2proc Tue Nov 20 22:35:38 2018 +0100 +++ b/yml2proc Fri Jan 25 23:31:57 2019 +0100 @@ -18,7 +18,7 @@ sys.exit(1) from yml2 import ymlCStyle, comment, oldSyntax -from pyPEG import parse, u +from pyPEG import parse import backend def printInfo(option, opt_str, value, parser): @@ -33,7 +33,7 @@ msg = str(msg) + "\n" except: msg = u(msg) + u"\n" - if type(msg) is unicode: + if type(msg) is str: msg = codecs.encode(msg, sys.stderr.encoding) sys.stderr.write(msg) @@ -182,7 +182,7 @@ if options.params: params = eval(options.params) for key, value in params.iteritems(): - if type(value) != unicode: + if type(value) != str: params[key] = u(value) if options.stringparams: for key, value in eval(options.stringparams).iteritems(): @@ -203,7 +203,7 @@ if options.pretty: plaintext = etree.tostring(etree.fromstring(rtext), pretty_print=True, xml_declaration=True, encoding=options.encoding) else: - if isinstance(rtext, unicode): + if isinstance(rtext, str): plaintext = codecs.encode(rtext, options.encoding) else: plaintext = str(rtext)