mirror of
https://github.com/f-droid/fdroidserver.git
synced 2026-05-18 13:39:55 -04:00
fix E721 type-comparison
This commit is contained in:
@@ -904,7 +904,7 @@ def parse_human_readable_size(size):
|
||||
try:
|
||||
return int(float(size))
|
||||
except (ValueError, TypeError) as exc:
|
||||
if type(size) != str:
|
||||
if type(size) is not str:
|
||||
raise ValueError(
|
||||
_('Could not parse size "{size}", wrong type "{type}"').format(
|
||||
size=size, type=type(size)
|
||||
@@ -2516,7 +2516,7 @@ def is_strict_application_id(name):
|
||||
|
||||
def parse_srclib_spec(spec):
|
||||
|
||||
if type(spec) != str:
|
||||
if type(spec) is not str:
|
||||
raise MetaDataException(
|
||||
_("can not parse scrlib spec (not a string): '{}'").format(spec)
|
||||
)
|
||||
|
||||
@@ -998,7 +998,7 @@ def upload_to_github_releases_repo(repo_conf, release_infos, global_gh_token):
|
||||
)
|
||||
return
|
||||
conf_package_names = repo_conf.get("packageNames", [])
|
||||
if type(conf_package_names) == str:
|
||||
if type(conf_package_names) is str:
|
||||
conf_package_names = [conf_package_names]
|
||||
if not conf_package_names:
|
||||
logging.warning(
|
||||
|
||||
@@ -2360,7 +2360,7 @@ def lint_config(arg):
|
||||
if type(data[key]) not in (str, list, dict):
|
||||
passed = False
|
||||
show_error = True
|
||||
elif type(data[key]) != t:
|
||||
elif type(data[key]) is not t:
|
||||
passed = False
|
||||
show_error = True
|
||||
if show_error:
|
||||
|
||||
@@ -390,7 +390,7 @@ class FieldValidator:
|
||||
def check(self, v, appid):
|
||||
if not v:
|
||||
return
|
||||
if type(v) == list:
|
||||
if type(v) is list:
|
||||
values = v
|
||||
else:
|
||||
values = [v]
|
||||
|
||||
@@ -973,7 +973,7 @@ def insert_funding_yml_donation_links(apps):
|
||||
)
|
||||
)
|
||||
logging.error(e)
|
||||
if not data or type(data) != dict:
|
||||
if not data or type(data) is not dict:
|
||||
continue
|
||||
if not app.get('Liberapay') and 'liberapay' in data:
|
||||
s = sanitize_funding_yml_name(data['liberapay'])
|
||||
|
||||
Reference in New Issue
Block a user