Add python3 support

This commit is contained in:
Safa Ariman
2019-06-06 01:31:19 +03:00
parent 68344a2d87
commit c90351220c
146 changed files with 806 additions and 1082 deletions
+7 -4
View File
@@ -13,7 +13,6 @@
import sys
import errno
import traceback
import exceptions
import signal
import pisi
@@ -24,21 +23,24 @@ import gettext
gettext.bindtextdomain('pisi', "/usr/share/locale")
gettext.textdomain('pisi')
__trans = gettext.translation('pisi', fallback=True)
_ = __trans.ugettext
_ = __trans.gettext
def sig_handler(sig, frame):
if sig == signal.SIGTERM:
exit()
def exit():
sys.exit(1)
def handle_exception(exception, value, tb):
signal.signal(signal.SIGINT, signal.SIG_IGN) # disable further interrupts
ui = pisi.cli.CLI() # make a temporary UI
ui = pisi.cli.CLI() # make a temporary UI
show_traceback = False
if exception == exceptions.KeyboardInterrupt:
if exception == KeyboardInterrupt:
ui.error(_("Keyboard Interrupt: Exiting..."))
exit()
elif isinstance(value, pisi.Error):
@@ -73,6 +75,7 @@ def handle_exception(exception, value, tb):
exit()
if __name__ == "__main__":
sys.excepthook = handle_exception