1- # Copyright (c) 2022 by Rocky Bernstein
1+ # Copyright (c) 2022-2023 by Rocky Bernstein
22#
33# This program is free software: you can redistribute it and/or modify
44# it under the terms of the GNU General Public License as published by
@@ -159,7 +159,7 @@ def n_classdef(self, node):
159159 # * class_name - the name of the class
160160 # * subclass_info - the parameters to the class e.g.
161161 # class Foo(bar, baz)
162- # -----------
162+ # - -----------
163163 # * subclass_code - the code for the subclass body
164164
165165 if node == "classdefdeco2" :
@@ -181,7 +181,7 @@ def n_classdef(self, node):
181181 subclass_code = build_class [- 3 ][1 ].attr
182182 class_name = node [0 ][0 ].pattr
183183 else :
184- raise "Internal Error n_classdef: cannot find class name"
184+ raise RuntimeError ( "Internal Error n_classdef: cannot find class name" )
185185
186186 if node == "classdefdeco2" :
187187 self .write ("\n " )
@@ -228,7 +228,8 @@ def n_const_list(self, node):
228228 else :
229229 # from trepan.api import debug; debug()
230230 raise TypeError (
231- f"Internal Error: n_const_list expects dict, list set, or set; got { lastnodetype } "
231+ ("Internal Error: n_const_list expects dict, list set, or set; got "
232+ f"{ lastnodetype } " )
232233 )
233234
234235 self .indent_more (INDENT_PER_LEVEL )
@@ -267,7 +268,7 @@ def n_const_list(self, node):
267268 if elem == "add_value" :
268269 elem = elem [0 ]
269270 if elem == "ADD_VALUE" :
270- if self .version [ 0 ] == 2 :
271+ if self .version < ( 3 , 0 , 0 ) :
271272 value = "%r" % elem .pattr
272273 else :
273274 value = "%s" % elem .pattr
0 commit comments