Skip to content

Commit

Permalink
replace exit() with sys.exit()
Browse files Browse the repository at this point in the history
  • Loading branch information
axu2 committed Sep 8, 2023
1 parent 424118b commit 30f8afc
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion kcc-c2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

if sys.version_info < (3, 8, 0):
print('ERROR: This is a Python 3.8+ script!')
exit(1)
sys.exit(1)

from multiprocessing import freeze_support, set_start_method
from kindlecomicconverter.startup import startC2E
Expand Down
2 changes: 1 addition & 1 deletion kcc-c2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

if sys.version_info < (3, 8, 0):
print('ERROR: This is a Python 3.8+ script!')
exit(1)
sys.exit(1)

from multiprocessing import freeze_support, set_start_method
from kindlecomicconverter.startup import startC2P
Expand Down
2 changes: 1 addition & 1 deletion kcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

if sys.version_info < (3, 8, 0):
print('ERROR: This is a Python 3.8+ script!')
exit(1)
sys.exit(1)

# OS specific workarounds
import os
Expand Down
4 changes: 2 additions & 2 deletions kindlecomicconverter/comic2ebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -1105,13 +1105,13 @@ def checkTools(source):
process.communicate()
if process.returncode != 0 and process.returncode != 7:
print('ERROR: 7z is missing!')
exit(1)
sys.exit(1)
if options.format == 'MOBI':
kindleGenExitCode = Popen('kindlegen -locale en', stdout=PIPE, stderr=STDOUT, stdin=PIPE, shell=True)
kindleGenExitCode.communicate()
if kindleGenExitCode.returncode != 0:
print('ERROR: KindleGen is missing!')
exit(1)
sys.exit(1)


def checkPre(source):
Expand Down
3 changes: 2 additions & 1 deletion kindlecomicconverter/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from html.parser import HTMLParser
from distutils.version import StrictVersion
from re import split
import sys
from traceback import format_tb


Expand Down Expand Up @@ -133,4 +134,4 @@ def dependencyCheck(level):
missing.append('Pillow 5.2.0+')
if len(missing) > 0:
print('ERROR: ' + ', '.join(missing) + ' is not installed!')
exit(1)
sys.exit(1)
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ def run(self):
os.system('pyinstaller -y -F -i icons/comic2ebook.icns -n "Kindle Comic Converter" -w -s kcc.py')
# TODO /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime dist/Applications/Kindle\ Comic\ Converter.app -v
os.system('appdmg kcc.json dist/KindleComicConverter_osx_' + VERSION + '.dmg')
exit(0)
sys.exit(0)
elif sys.platform == 'win32':
os.system('pyinstaller -y -F -i icons\\comic2ebook.ico -n KCC_' + VERSION + ' -w --noupx kcc.py')
exit(0)
sys.exit(0)
elif sys.platform == 'linux':
os.system(
'pyinstaller --hidden-import=queue -y -F -i icons/comic2ebook.ico -n kcc_linux_' + VERSION + ' kcc.py')
exit(0)
sys.exit(0)
else:
exit(0)
sys.exit(0)


setuptools.setup(
Expand Down

0 comments on commit 30f8afc

Please sign in to comment.