%global _empty_manifest_terminate_build 0
Name: python-flake8-blind-except
Version: 0.2.1
Release: 1
Summary: A flake8 extension that checks for blind except: statements
License: MIT
URL: https://github.com/elijahandrews/flake8-blind-except
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/be/f8/cb5e0b8c948cb347b8942cb7ce73292a77ec8f9eafb8d5db999c5c1ac62f/flake8-blind-except-0.2.1.tar.gz
BuildArch: noarch
%description
A flake8 extension that checks for blind, catch-all ``except:`` and ``except Exception:`` statements.
As of `pycodestyle 2.1.0 `_, "E722 do not use bare except, specify exception instead" is built-in. However, bare ``Exception`` and ``BaseException`` are still allowed. This extension flags them as `B902`.
Using ``except`` without explicitly specifying which exceptions to catch is generally considered bad practice, since it catches system signals like ``SIGINT``. You probably want to handle system interrupts differently than exceptions occurring in your code.
It's also usually better style to have many small ``try``-``except`` blocks catching specific exceptions instead of a giant ``try:`` block with a catch-all ``except:`` at the bottom. It's also nicer to your fellow programmers to be a bit more specific about what exceptions they can expect in specific parts of the code, and what the proper course of action is when they occur.
An example of code that will fail this check is:
try:
something_scary()
except:
everybody_panic()
However, the following code is valid:
try:
something_terrifying()
except TerrifyingException:
dont_panic()
%package -n python3-flake8-blind-except
Summary: A flake8 extension that checks for blind except: statements
Provides: python-flake8-blind-except
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-flake8-blind-except
A flake8 extension that checks for blind, catch-all ``except:`` and ``except Exception:`` statements.
As of `pycodestyle 2.1.0 `_, "E722 do not use bare except, specify exception instead" is built-in. However, bare ``Exception`` and ``BaseException`` are still allowed. This extension flags them as `B902`.
Using ``except`` without explicitly specifying which exceptions to catch is generally considered bad practice, since it catches system signals like ``SIGINT``. You probably want to handle system interrupts differently than exceptions occurring in your code.
It's also usually better style to have many small ``try``-``except`` blocks catching specific exceptions instead of a giant ``try:`` block with a catch-all ``except:`` at the bottom. It's also nicer to your fellow programmers to be a bit more specific about what exceptions they can expect in specific parts of the code, and what the proper course of action is when they occur.
An example of code that will fail this check is:
try:
something_scary()
except:
everybody_panic()
However, the following code is valid:
try:
something_terrifying()
except TerrifyingException:
dont_panic()
%package help
Summary: Development documents and examples for flake8-blind-except
Provides: python3-flake8-blind-except-doc
%description help
A flake8 extension that checks for blind, catch-all ``except:`` and ``except Exception:`` statements.
As of `pycodestyle 2.1.0 `_, "E722 do not use bare except, specify exception instead" is built-in. However, bare ``Exception`` and ``BaseException`` are still allowed. This extension flags them as `B902`.
Using ``except`` without explicitly specifying which exceptions to catch is generally considered bad practice, since it catches system signals like ``SIGINT``. You probably want to handle system interrupts differently than exceptions occurring in your code.
It's also usually better style to have many small ``try``-``except`` blocks catching specific exceptions instead of a giant ``try:`` block with a catch-all ``except:`` at the bottom. It's also nicer to your fellow programmers to be a bit more specific about what exceptions they can expect in specific parts of the code, and what the proper course of action is when they occur.
An example of code that will fail this check is:
try:
something_scary()
except:
everybody_panic()
However, the following code is valid:
try:
something_terrifying()
except TerrifyingException:
dont_panic()
%prep
%autosetup -n flake8-blind-except-0.2.1
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-flake8-blind-except -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Fri Apr 21 2023 Python_Bot - 0.2.1-1
- Package Spec generated