Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: No traceback when Python interpreter is running with -P, allow -P in shebang lines #2089

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions bin/dnf-automatic.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ if here == '/usr/bin':
# we never import Python modules from /usr/bin
# removing this lowers the risk of accidental imports of weird files
del sys.path[0]
else:
# git checkout
dnf_toplevel = os.path.dirname(here)
sys.path[0] = dnf_toplevel

import dnf.automatic.main
sys.exit(dnf.automatic.main.main(sys.argv[1:]))
5 changes: 0 additions & 5 deletions bin/dnf.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ if here == '/usr/bin':
# we never import Python modules from /usr/bin
# removing this lowers the risk of accidental imports of weird files
del sys.path[0]
else:
# git checkout
import os
dnf_toplevel = os.path.dirname(here)
sys.path[0] = dnf_toplevel

from dnf.cli import main
main.user_main(sys.argv[1:], exit_code=True)
4 changes: 0 additions & 4 deletions dnf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,6 @@ rm %{buildroot}%{_mandir}/man5/%{name}.conf.5*
%endif

%if 0%{?fedora} >= 41 || 0%{?rhel} >= 10
# Don't add -P to Python shebangs
# The executable Python scripts import each other
%undefine _py3_shebang_P

%py3_shebang_fix %{buildroot}%{_bindir}/dnf-3
%py3_shebang_fix %{buildroot}%{_bindir}/dnf-automatic
%py3_shebang_fix %{buildroot}%{python3_sitelib}/%{name}/cli/completion_helper.py
Expand Down