From 8f62f098ee03fcc0ab5525fb1ecf2522f2b5fc27 Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Sat, 11 Feb 2023 16:03:47 -0600 Subject: [PATCH] Incorporate run.py into __main__.py for setuptools setuptools creates a broken cq-editor.exe that has a non-working ipython console --- cq_editor/__main__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cq_editor/__main__.py b/cq_editor/__main__.py index 0fc8f70..7a37e95 100644 --- a/cq_editor/__main__.py +++ b/cq_editor/__main__.py @@ -1,8 +1,19 @@ import sys +import os +import asyncio import argparse +import faulthandler from PyQt5.QtWidgets import QApplication +faulthandler.enable() + +if 'CASROOT' in os.environ: + del os.environ['CASROOT'] + +if sys.platform == 'win32': + asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) + NAME = 'CQ-editor' #need to initialize QApp here, otherewise svg icons do not work on windows