Skip to content

Commit 990434f

Browse files
committed
Update main_server.py
1 parent 21fce0d commit 990434f

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

main_server.py

+19-17
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,12 @@
5858

5959
if not ctypes.windll.shell32.IsUserAnAdmin():
6060
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
61-
61+
sys.exit()
62+
exit()
6263

6364
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
6465
os.add_dll_directory(os.getcwd())
6566

66-
with open('config.json', encoding="utf-8") as f:
67-
config = json.load(f)
68-
69-
if config["settings"]["mp3_method"] == "vlc":
70-
try:
71-
import vlc
72-
except: pass
73-
else:
74-
try:
75-
import pygame
76-
import pygame._sdl2.audio as sdl2_audio
77-
except Exception:
78-
pass
79-
pygame.init()
80-
pygame.mixer.init()
81-
8267
new_user = False
8368
if not os.path.exists("config.json"):
8469
shutil.copy("config_default.json", "config.json")
@@ -99,6 +84,23 @@
9984
shortcut.IconLocation = icon
10085
shortcut.save()
10186

87+
with open('config.json', encoding="utf-8") as f:
88+
config = json.load(f)
89+
90+
if config["settings"]["mp3_method"] == "vlc":
91+
try:
92+
import vlc
93+
except: pass
94+
else:
95+
try:
96+
import pygame
97+
import pygame._sdl2.audio as sdl2_audio
98+
except Exception:
99+
pass
100+
pygame.init()
101+
pygame.mixer.init()
102+
103+
102104
# def blockPrint():
103105
# sys.stdout = open(os.devnull, 'w')
104106
#

0 commit comments

Comments
 (0)