Skip to content

Commit 90b45bb

Browse files
committed
Changes to run.py to make it work with Windows
1 parent 0f2d763 commit 90b45bb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

run.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import os, sys, asyncio
1+
import sys
22
import faulthandler
33

4-
faulthandler.enable()
5-
6-
if "CASROOT" in os.environ:
7-
del os.environ["CASROOT"]
4+
# PyInstaller with console=False sets sys.stdout/stderr to None on Windows
5+
if sys.stdout is None:
6+
sys.stdout = open("nul", "w")
7+
if sys.stderr is None:
8+
sys.stderr = open("nul", "w")
89

9-
if sys.platform == "win32":
10-
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
10+
faulthandler.enable()
1111

12-
from cq_editor.__main__ import main
12+
from cq_editor.cqe_run import main
1313

1414
if __name__ == "__main__":
1515
main()

0 commit comments

Comments
 (0)