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 96145c7 commit 94e24baCopy full SHA for 94e24ba
addons/source-python/packages/source-python/cvars/__init__.py
@@ -48,15 +48,16 @@ def __init__(self, *convars):
48
49
_convars = []
50
for convar in convars:
51
- if not isinstance(convar, (str, ConVar)):
+ if isinstance(convar, str):
52
+ convar_name = convar
53
+ elif isinstance(convar, ConVar):
54
+ convar_name = convar.name
55
+ else:
56
raise ValueError('Given convar is not ConVar or ConVar name.')
57
- elif isinstance(convar, str):
- convar_name = convar
- convar = cvar.find_var(convar_name)
- if convar is None:
58
- raise ValueError(
59
- f'"{convar_name}" is not a valid ConVar name.')
+ convar = cvar.find_var(convar_name)
+ if convar is None:
60
+ raise ValueError(f'"{convar_name}" is not a valid ConVar.')
61
62
_convars.append(convar)
63
0 commit comments