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