Skip to content

Commit

Permalink
Misc: Remove not needed else branches
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Jul 20, 2020
1 parent 62cbedb commit ee69ca6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions weblate/checks/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def __init__(self, *args):
def get_items(self, flags):
if isinstance(flags, str):
return self.parse(flags)
elif hasattr(flags, "tag"):
if hasattr(flags, "tag"):
return self.parse_xml(flags)
elif isinstance(flags, Flags):
if isinstance(flags, Flags):
return flags.items()
return flags

Expand Down
27 changes: 13 additions & 14 deletions weblate/utils/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,19 @@ def get_db_version():
"https://www.postgresql.org/",
version[0].split(" ")[0],
)
else:
try:
with connection.cursor() as cursor:
version = cursor.connection.get_server_info()
except RuntimeError:
report_error(cause="MySQL version check")
return None
return (
f"{connection.display_name} sever",
"https://mariadb.org/"
if connection.mysql_is_mariadb
else "https://www.mysql.com/",
version.split("-", 1)[0],
)
try:
with connection.cursor() as cursor:
version = cursor.connection.get_server_info()
except RuntimeError:
report_error(cause="MySQL version check")
return None
return (
f"{connection.display_name} sever",
"https://mariadb.org/"
if connection.mysql_is_mariadb
else "https://www.mysql.com/",
version.split("-", 1)[0],
)


def get_cache_version():
Expand Down

0 comments on commit ee69ca6

Please sign in to comment.