We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94e24ba commit 6fea4b5Copy full SHA for 6fea4b5
addons/source-python/packages/source-python/cvars/__init__.py
@@ -48,16 +48,15 @@ def __init__(self, *convars):
48
49
_convars = []
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:
+ if not isinstance(convar, (str, ConVar)):
56
raise ValueError('Given convar is not ConVar or ConVar name.')
57
58
- convar = cvar.find_var(convar_name)
59
- if convar is None:
60
- raise ValueError(f'"{convar_name}" is not a valid ConVar.')
+ elif isinstance(convar, str):
+ convar_name = convar
+ convar = cvar.find_var(convar_name)
+ if convar is None:
+ raise ValueError(
+ f'"{convar_name}" is not a valid ConVar name.')
61
62
_convars.append(convar)
63
0 commit comments