Skip to content

Commit 72bb4fc

Browse files
committed
Replace match statement with if-else chain for compatibility with Python 3.9 in CI checks
1 parent 146b618 commit 72bb4fc

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

modules/azurite/testcontainers/azurite/__init__.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,15 @@ def get_connection_string(
106106
:rtype: str
107107
:raises ValueError: If an unrecognized `connection_string_type` is provided.
108108
"""
109-
match connection_string_type:
110-
case ConnectionStringType.LOCALHOST:
111-
return self.__get_local_connection_string()
112-
case ConnectionStringType.NETWORK:
113-
return self.__get_external_connection_string()
114-
case _:
115-
raise ValueError(
116-
f"unrecognized connection string type {connection_string_type}, "
117-
f"Supported values are ConnectionStringType.LOCALHOST or ConnectionStringType.NETWORK "
118-
)
109+
if connection_string_type == ConnectionStringType.LOCALHOST:
110+
return self.__get_local_connection_string()
111+
elif connection_string_type == ConnectionStringType.NETWORK:
112+
return self.__get_external_connection_string()
113+
else:
114+
raise ValueError(
115+
f"unrecognized connection string type {connection_string_type}, "
116+
f"Supported values are ConnectionStringType.LOCALHOST or ConnectionStringType.NETWORK "
117+
)
119118

120119
def __get_local_connection_string(self) -> str:
121120
"""Generates a connection string for Azurite accessible from the local host machine.

0 commit comments

Comments
 (0)