mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[V3] Use sys.exit() over exit() (#1755)
This commit is contained in:
parent
ddbbba4aaa
commit
c1f09326cc
14
generate_strings.py
Normal file → Executable file
14
generate_strings.py
Normal file → Executable file
@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@ -13,25 +14,24 @@ def main():
|
|||||||
os.chdir(os.path.join("redbot/cogs", d, "locales"))
|
os.chdir(os.path.join("redbot/cogs", d, "locales"))
|
||||||
if "regen_messages.py" not in os.listdir(os.getcwd()):
|
if "regen_messages.py" not in os.listdir(os.getcwd()):
|
||||||
print(
|
print(
|
||||||
"Directory 'locales' exists for {} but no 'regen_messages.py' is available!".format(
|
f"Directory 'locales' exists for {d} but no 'regen_messages.py' is available!"
|
||||||
d
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
exit(1)
|
return 1
|
||||||
else:
|
else:
|
||||||
print("Running 'regen_messages.py' for {}".format(d))
|
print("Running 'regen_messages.py' for {}".format(d))
|
||||||
retval = subprocess.run([interpreter, "regen_messages.py"])
|
retval = subprocess.run([interpreter, "regen_messages.py"])
|
||||||
if retval.returncode != 0:
|
if retval.returncode != 0:
|
||||||
exit(1)
|
return 1
|
||||||
os.chdir(root_dir)
|
os.chdir(root_dir)
|
||||||
os.chdir("redbot/core/locales")
|
os.chdir("redbot/core/locales")
|
||||||
print("Running 'regen_messages.py' for core")
|
print("Running 'regen_messages.py' for core")
|
||||||
retval = subprocess.run([interpreter, "regen_messages.py"])
|
retval = subprocess.run([interpreter, "regen_messages.py"])
|
||||||
if retval.returncode != 0:
|
if retval.returncode != 0:
|
||||||
exit(1)
|
return 1
|
||||||
os.chdir(root_dir)
|
os.chdir(root_dir)
|
||||||
subprocess.run(["crowdin", "upload"])
|
subprocess.run(["crowdin", "upload"])
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
sys.exit(main())
|
||||||
|
|||||||
@ -383,7 +383,7 @@ def debug_info():
|
|||||||
+ "User: {}\n".format(user_who_ran)
|
+ "User: {}\n".format(user_who_ran)
|
||||||
)
|
)
|
||||||
print(info)
|
print(info)
|
||||||
exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
def main_menu():
|
def main_menu():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user