Skip to content

Commit 9e3acba

Browse files
author
Sakthivel Ramasamy (sakthram)
committed
Remove backslash from f-string
Remove backslash from f-string to maintain backward compatibility with Python 3.10 and 3.11 versions. Also, corrected little (very minor non-impacting) cosmetic issues.
1 parent e851508 commit 9e3acba

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/webexpythonsdk/models/cards/utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def check_type(
5959
"We were expecting to receive a list of objects of the "
6060
"following types: "
6161
f"{', '.join([repr(t.__name__) for t in acceptable_types])}"
62-
f"{' or \'None\'' if optional else ''}; instead we received "
63-
f"{obj} which is a {repr(type(obj).__name__)}."
62+
f"{' or None' if optional else ''}; instead we received "
63+
f"'{obj}' which is a '{repr(type(obj).__name__)}'."
6464
)
6565
raise TypeError(error_message)
6666

@@ -70,8 +70,8 @@ def check_type(
7070
"We were expecting to receive an object of one of the "
7171
"following types: "
7272
f"{', '.join(repr(t.__name__) for t in acceptable_types)}"
73-
f"{' or \'None\'' if optional else ''}; instead we "
74-
f"received {o} which is a {repr(type(o).__name__)}."
73+
f"{' or None' if optional else ''}; instead we "
74+
f"received '{o}' which is a '{repr(type(o).__name__)}'."
7575
)
7676
raise TypeError(error_message)
7777
return
@@ -82,8 +82,8 @@ def check_type(
8282
error_message = (
8383
"We were expecting to receive an instance of one of the following "
8484
f"types: {', '.join(repr(t.__name__) for t in acceptable_types)}"
85-
f"{' or \'None\'' if optional else ''}; but instead we received "
86-
f"{obj} which is a {repr(type(obj).__name__)}."
85+
f"{' or None' if optional else ''}; but instead we received "
86+
f"'{obj}' which is a '{repr(type(obj).__name__)}'."
8787
)
8888

8989
raise TypeError(error_message)
@@ -141,7 +141,7 @@ def validate_input(
141141
if value_to_check not in allowed_values:
142142
raise ValueError(
143143
f"Invalid value: '{input_value}'. "
144-
f"Must be one of {expected_values}."
144+
f"Must be one of '{expected_values}'."
145145
)
146146

147147
return

0 commit comments

Comments
 (0)