1
- # Copyright (c) 2022 by Rocky Bernstein
1
+ # Copyright (c) 2022-2023 by Rocky Bernstein
2
2
#
3
3
# This program is free software: you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
@@ -159,7 +159,7 @@ def n_classdef(self, node):
159
159
# * class_name - the name of the class
160
160
# * subclass_info - the parameters to the class e.g.
161
161
# class Foo(bar, baz)
162
- # -----------
162
+ # - -----------
163
163
# * subclass_code - the code for the subclass body
164
164
165
165
if node == "classdefdeco2" :
@@ -181,7 +181,7 @@ def n_classdef(self, node):
181
181
subclass_code = build_class [- 3 ][1 ].attr
182
182
class_name = node [0 ][0 ].pattr
183
183
else :
184
- raise "Internal Error n_classdef: cannot find class name"
184
+ raise RuntimeError ( "Internal Error n_classdef: cannot find class name" )
185
185
186
186
if node == "classdefdeco2" :
187
187
self .write ("\n " )
@@ -228,7 +228,8 @@ def n_const_list(self, node):
228
228
else :
229
229
# from trepan.api import debug; debug()
230
230
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 } " )
232
233
)
233
234
234
235
self .indent_more (INDENT_PER_LEVEL )
@@ -267,7 +268,7 @@ def n_const_list(self, node):
267
268
if elem == "add_value" :
268
269
elem = elem [0 ]
269
270
if elem == "ADD_VALUE" :
270
- if self .version [ 0 ] == 2 :
271
+ if self .version < ( 3 , 0 , 0 ) :
271
272
value = "%r" % elem .pattr
272
273
else :
273
274
value = "%s" % elem .pattr
0 commit comments