mirror of https://github.com/KLayout/klayout.git
Fixing PCellDeclaration helper (correct use of 'raise'
This commit is contained in:
parent
58417d5700
commit
8b44a3ba13
|
|
@ -358,10 +358,10 @@ class _PCellDeclarationHelper(pya.PCellDeclaration):
|
|||
pdecl.unit = unit
|
||||
if not (choices is None):
|
||||
if not isinstance(choices, list) and not isinstance(choices, tuple):
|
||||
raise "choices value must be an list/tuple of two-element arrays (description, value)"
|
||||
raise TypeError("choices value must be an list/tuple of two-element arrays (description, value)")
|
||||
for c in choices:
|
||||
if (not isinstance(choices, list) and not isinstance(choices, tuple)) or len(c) != 2:
|
||||
raise "choices value must be an list/tuple of two-element arrays (description, value)"
|
||||
raise TypeError("choices value must be an list/tuple of two-element arrays (description, value)")
|
||||
pdecl.add_choice(c[0],c[1])
|
||||
|
||||
# return the declaration object for further operations
|
||||
|
|
|
|||
Loading…
Reference in New Issue