data_models: fix `get_a_sample_data_model` for Python 3.10 and 3.11

This commit is contained in:
Sina Atalay 2024-04-29 00:17:14 +03:00
parent 28ae2aea2c
commit 9e8cc5e4c2
1 changed files with 3 additions and 2 deletions

View File

@ -1189,9 +1189,10 @@ def get_a_sample_data_model(
""" """
# check if the theme is valid: # check if the theme is valid:
if theme not in available_themes: if theme not in available_themes:
available_themes_string = ", ".join(available_themes)
raise ValueError( raise ValueError(
f"The theme should be one of the following: {", ".join(available_themes)}!" f"The theme should be one of the following: {available_themes_string}!"
f" The provided theme is \"{theme}\"." f' The provided theme is "{theme}".'
) )
name = name.encode().decode("unicode-escape") name = name.encode().decode("unicode-escape")