diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e7a85d2a8d..bbe343afe7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,10 @@ jobs: run: | python --version pip --version - pip install --upgrade setuptools wheel + # XXX With setuptools 63.4.3 .. 64.0.0 the scintilla nmake won't compile ( + # setuptools.msvc._msvc14_get_vc_env() won't get the VC\INCLUDE into os.environ) + # Lets see if this will be fixed again in higher versions + pip install --upgrade setuptools<=63.2.0 wheel - name: Build and install run: | @@ -80,7 +83,7 @@ jobs: run: | python --version pip --version - pip install --upgrade setuptools wheel + pip install --upgrade setuptools<=63.2.0 wheel - name: Obtain ARM64 library files run: | diff --git a/Pythonwin/Scintilla/makefile_pythonwin b/Pythonwin/Scintilla/makefile_pythonwin index 46c446ffa6..baf2889570 100644 --- a/Pythonwin/Scintilla/makefile_pythonwin +++ b/Pythonwin/Scintilla/makefile_pythonwin @@ -32,7 +32,7 @@ all: ..\pywin\scintilla\scintillacon.py Scintilla clean: - cd win32 && $(MAKE) /$(MAKEFLAGS) -f scintilla_vc6.mak DIR_BIN=$(SUB_DIR_BIN) DIR_O=$(SUB_DIR_O) clean & cd.. + cd win32 && $(MAKE) /$(MAKEFLAGS) -f scintilla.mak DIR_BIN=$(SUB_DIR_BIN) DIR_O=$(SUB_DIR_O) clean & cd.. Scintilla: @if not exist $(DIR_O) md $(DIR_O) @@ -40,7 +40,9 @@ Scintilla: @set DEBUG=$(DEBUG) @set CL=$(CL) /nologo @set LINK=$(LINK) /nologo - @cd win32 && $(MAKE) /$(MAKEFLAGS) /f scintilla_vc6.mak DIR_BIN=$(SUB_DIR_BIN) DIR_O=$(SUB_DIR_O) LEXCOMPONENT=$(SCINTILLA_DLL) COMPONENT=dummy $(SCINTILLA_DLL) & cd.. + where cl + set INCLUDE + @cd win32 && $(MAKE) /$(MAKEFLAGS) /f scintilla.mak DIR_BIN=$(SUB_DIR_BIN) DIR_O=$(SUB_DIR_O) LEXCOMPONENT=$(SCINTILLA_DLL) COMPONENT=dummy $(SCINTILLA_DLL) & cd.. ..\pywin\scintilla\scintillacon.py: Include\Scintilla.h Include\SciLexer.h @if not exist $(DIR_PYTHON)\tools\scripts\h2py.py echo ***** Can't find h2py.py in '$(DIR_PYTHON)\tools\scripts - please pass DIR_PYTHON to this script ******* diff --git a/Pythonwin/Scintilla/win32/scintilla.mak b/Pythonwin/Scintilla/win32/scintilla.mak index 46c2aa032d..b1cfa250ed 100644 --- a/Pythonwin/Scintilla/win32/scintilla.mak +++ b/Pythonwin/Scintilla/win32/scintilla.mak @@ -35,12 +35,14 @@ CC=cl RC=rc LD=link -CXXFLAGS=-Zi -TP -W4 -Zc:forScope -Zc:wchar_t -D_CRT_SECURE_NO_DEPRECATE=1 +#~ -Zc:forScope -Zc:wchar_t -D_CRT_SECURE_NO_DEPRECATE=1 +CXXFLAGS=-Zi -TP -W4 # For something scary:-Wp64 CXXDEBUG=-Od -MTd -DDEBUG -CXXNDEBUG=-O1 -MT -DNDEBUG -GL +CXXNDEBUG=-O1 -MT -DNDEBUG +#~ -GL NAME=-Fo -LDFLAGS=-OPT:NOWIN98 -OPT:REF -LTCG -DEBUG +#~ LDFLAGS=-OPT:NOWIN98 -OPT:REF -LTCG -DEBUG LDDEBUG= LIBS=KERNEL32.lib USER32.lib GDI32.lib IMM32.lib OLE32.LIB NOLOGO=-nologo diff --git a/Pythonwin/pywin/framework/toolmenu.py b/Pythonwin/pywin/framework/toolmenu.py index e12cb83127..bd4c7138f0 100644 --- a/Pythonwin/pywin/framework/toolmenu.py +++ b/Pythonwin/pywin/framework/toolmenu.py @@ -19,7 +19,10 @@ ), ("Edit Python Path", "from pywin.tools import regedit;regedit.EditRegistry()"), ("COM Makepy utility", "from win32com.client import makepy;makepy.main()"), - ("COM Browser", "from win32com.client import combrowse;combrowse.main()"), + ( + "COM Browser", + "from win32com.client import combrowse;combrowse.main(modal=False)", + ), ( "Trace Collector Debugging tool", "from pywin.tools import TraceCollector;TraceCollector.MakeOutputWindow()", diff --git a/com/win32com/client/combrowse.py b/com/win32com/client/combrowse.py index 147e2bafbb..dd95bfe883 100644 --- a/com/win32com/client/combrowse.py +++ b/com/win32com/client/combrowse.py @@ -4,7 +4,7 @@ Command Prompt - Use the command *"python.exe catbrowse.py"*. This will display + Use the command *"python.exe combrowse.py"*. This will display display a fairly small, modal dialog. Pythonwin @@ -591,17 +591,15 @@ def GetSubList(self): return ret -def main(modal=False): +def main(modal=True, mdi=False): from pywin.tools import hierlist root = HLIRoot("COM Browser") - if "app" in sys.modules: - # do it in a window + if mdi and "pywin.framework.app" in sys.modules: + # do it in a MDI window browser.MakeTemplate() browser.template.OpenObject(root) else: - # list=hierlist.HierListWithItems( root, win32ui.IDB_BROWSER_HIER ) - # dlg=hierlist.HierDialog("COM Browser",list) dlg = browser.dynamic_browser(root) if modal: dlg.DoModal() @@ -611,7 +609,7 @@ def main(modal=False): if __name__ == "__main__": - main() + main(modal=win32api.GetConsoleTitle()) ni = pythoncom._GetInterfaceCount() ng = pythoncom._GetGatewayCount() diff --git a/com/win32com/client/tlbrowse.py b/com/win32com/client/tlbrowse.py index 2666abb695..fbf96e68ab 100644 --- a/com/win32com/client/tlbrowse.py +++ b/com/win32com/client/tlbrowse.py @@ -273,8 +273,7 @@ def GetTemplate(self): except: pass dlg = TypeBrowseDialog(fname) - try: - win32api.GetConsoleTitle() + if win32api.GetConsoleTitle(): # empty string w/o console dlg.DoModal() - except: + else: dlg.CreateWindow(win32ui.GetMainFrame()) diff --git a/setup.py b/setup.py index 7fde369b2e..d88315c773 100644 --- a/setup.py +++ b/setup.py @@ -655,8 +655,13 @@ def _build_scintilla(self): cwd = os.getcwd() old_env = os.environ.copy() os.chdir(path) + print("-- _build_scintilla INCLUDE old:", os.environ.get("INCLUDE")) + if not self.compiler.initialized: + print("-- _build_scintilla compiler.initialize()") + self.compiler.initialize() os.environ["INCLUDE"] = os.pathsep.join(self.compiler.include_dirs) os.environ["LIB"] = os.pathsep.join(self.compiler.library_dirs) + print("-- _build_scintilla INCLUDE new:", os.environ.get("INCLUDE")) try: cmd = [nmake, "/nologo", "/f", makefile] + makeargs self.compiler.spawn(cmd)