forked from platformio/platformio-core
Fix "Unnecessary "else/elif" after "raise"" by PyLint
This commit is contained in:
@ -84,9 +84,7 @@ WARNING! Don't use `sudo` for the rest PlatformIO commands.
|
|||||||
fg="yellow",
|
fg="yellow",
|
||||||
err=True)
|
err=True)
|
||||||
raise exception.ReturnErrorCode(1)
|
raise exception.ReturnErrorCode(1)
|
||||||
else:
|
raise exception.UpgradeError("\n".join([str(cmd), r['out'], r['err']]))
|
||||||
raise exception.UpgradeError("\n".join(
|
|
||||||
[str(cmd), r['out'], r['err']]))
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -277,8 +277,7 @@ class LibraryManager(BasePkgManager):
|
|||||||
if not lib_info:
|
if not lib_info:
|
||||||
if list(filters) == ["name"]:
|
if list(filters) == ["name"]:
|
||||||
raise exception.LibNotFound(filters['name'])
|
raise exception.LibNotFound(filters['name'])
|
||||||
else:
|
raise exception.LibNotFound(str(filters))
|
||||||
raise exception.LibNotFound(str(filters))
|
|
||||||
if not silent:
|
if not silent:
|
||||||
click.echo("Found: %s" % click.style(
|
click.echo("Found: %s" % click.style(
|
||||||
"https://platformio.org/lib/show/{id}/{name}".format(
|
"https://platformio.org/lib/show/{id}/{name}".format(
|
||||||
|
@ -481,7 +481,7 @@ class PkgInstallerMixin(object):
|
|||||||
if versions is None:
|
if versions is None:
|
||||||
util.internet_on(raise_exception=True)
|
util.internet_on(raise_exception=True)
|
||||||
raise exception.UnknownPackage(name)
|
raise exception.UnknownPackage(name)
|
||||||
elif not pkgdata:
|
if not pkgdata:
|
||||||
raise exception.UndefinedPackageVersion(requirements or "latest",
|
raise exception.UndefinedPackageVersion(requirements or "latest",
|
||||||
util.get_systype())
|
util.get_systype())
|
||||||
return pkg_dir
|
return pkg_dir
|
||||||
|
@ -643,10 +643,9 @@ def _get_api_result(
|
|||||||
except requests.exceptions.HTTPError as e:
|
except requests.exceptions.HTTPError as e:
|
||||||
if result and "message" in result:
|
if result and "message" in result:
|
||||||
raise exception.APIRequestError(result['message'])
|
raise exception.APIRequestError(result['message'])
|
||||||
elif result and "errors" in result:
|
if result and "errors" in result:
|
||||||
raise exception.APIRequestError(result['errors'][0]['title'])
|
raise exception.APIRequestError(result['errors'][0]['title'])
|
||||||
else:
|
raise exception.APIRequestError(e)
|
||||||
raise exception.APIRequestError(e)
|
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise exception.APIRequestError(
|
raise exception.APIRequestError(
|
||||||
"Invalid response: %s" % r.text.encode("utf-8"))
|
"Invalid response: %s" % r.text.encode("utf-8"))
|
||||||
|
Reference in New Issue
Block a user