diff options
author | Chris Mayo <aklhfex@gmail.com> | 2022-11-02 19:29:56 +0000 |
---|---|---|
committer | Frediano Ziglio <freddy77@gmail.com> | 2023-12-16 18:45:43 +0000 |
commit | 29dacb5f53f5183fb089a3fb02d081dd08bde8a1 (patch) | |
tree | 7548d9c5cae3960dbedf1f430c714f64e306ce9d /python_modules | |
parent | 91fc091358ac4906a05b68d70e9db94082c0749f (diff) |
Stop using Python six package
Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
Diffstat (limited to 'python_modules')
-rw-r--r-- | python_modules/codegen.py | 6 | ||||
-rw-r--r-- | python_modules/spice_parser.py | 10 |
2 files changed, 5 insertions, 11 deletions
diff --git a/python_modules/codegen.py b/python_modules/codegen.py index bfb2351..affe5bc 100644 --- a/python_modules/codegen.py +++ b/python_modules/codegen.py @@ -1,5 +1,4 @@ -import six from io import StringIO def camel_to_underscores(s, upper = False): @@ -123,10 +122,7 @@ class CodeWriter: def write(self, s): # Ensure its a unicode string - if six.PY3: - s = str(s) - else: - s = unicode(s) + s = str(s) if len(s) == 0: return diff --git a/python_modules/spice_parser.py b/python_modules/spice_parser.py index 4d753cb..1dc7e22 100644 --- a/python_modules/spice_parser.py +++ b/python_modules/spice_parser.py @@ -1,11 +1,9 @@ -import six - try: from pyparsing import Literal, CaselessLiteral, Word, OneOrMore, ZeroOrMore, \ Forward, delimitedList, Group, Optional, Combine, alphas, nums, restOfLine, cStyleComment, \ alphanums, ParseException, ParseResults, Keyword, StringEnd, replaceWith except ImportError: - six.print_("Module pyparsing not found.") + print("Module pyparsing not found.") exit(1) @@ -149,9 +147,9 @@ def parse(filename): bnf = SPICE_BNF() types = bnf.parseFile(filename) except ParseException as err: - six.print_(err.line, file=sys.stderr) - six.print_(" "*(err.column-1) + "^", file=sys.stderr) - six.print_(err, file=sys.stderr) + print(err.line, file=sys.stderr) + print(" "*(err.column-1) + "^", file=sys.stderr) + print(err, file=sys.stderr) return None for t in types: |