File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
addons/source-python/packages/source-python/cvars Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -48,16 +48,15 @@ def __init__(self, *convars):
48
48
49
49
_convars = []
50
50
for convar in convars :
51
- if isinstance (convar , str ):
52
- convar_name = convar
53
- elif isinstance (convar , ConVar ):
54
- convar_name = convar .name
55
- else :
51
+ if not isinstance (convar , (str , ConVar )):
56
52
raise ValueError ('Given convar is not ConVar or ConVar name.' )
57
53
58
- convar = cvar .find_var (convar_name )
59
- if convar is None :
60
- raise ValueError (f'"{ convar_name } " is not a valid ConVar.' )
54
+ elif isinstance (convar , str ):
55
+ convar_name = convar
56
+ convar = cvar .find_var (convar_name )
57
+ if convar is None :
58
+ raise ValueError (
59
+ f'"{ convar_name } " is not a valid ConVar name.' )
61
60
62
61
_convars .append (convar )
63
62
You can’t perform that action at this time.
0 commit comments