Skip to content

Commit d143400

Browse files
condense variable_type assignment
1 parent cfe62be commit d143400

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

optimizely/optimizely.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,8 @@ def _get_feature_variable_for_type(self, feature_key, variable_key, variable_typ
204204
return None
205205

206206
# For non-typed method, use type of variable; else, return None if type differs
207-
if not variable_type:
208-
variable_type = variable.type
209-
elif variable.type != variable_type:
207+
variable_type = variable_type or variable.type
208+
if variable.type != variable_type:
210209
self.logger.warning(
211210
'Requested variable type "%s", but variable is of type "%s". '
212211
'Use correct API to retrieve value. Returning None.' % (variable_type, variable.type)

0 commit comments

Comments
 (0)