feat: integrate native diagnostics and coordinated CBB transactions
This commit is contained in:
1 parent
9e230e1a46
commit
da67de026f
91 files changed
+14370
-435
No files matched your search
@@ -0,0 +1,18 @@
|
||||
"""Balanced COM initialization without tearing down an existing MTA caller."""
|
||||
|
||||
|
||||
def initialize_com():
|
||||
import pythoncom
|
||||
try:
|
||||
pythoncom.CoInitializeEx(pythoncom.COINIT_APARTMENTTHREADED)
|
||||
except pythoncom.com_error as error:
|
||||
if error.hresult != -2147417850: # RPC_E_CHANGED_MODE
|
||||
raise
|
||||
return False # Existing apartment is usable; no reference was added.
|
||||
return True
|
||||
|
||||
|
||||
def uninitialize_com(initialized):
|
||||
if initialized:
|
||||
import pythoncom
|
||||
pythoncom.CoUninitialize()
|
||||
Reference in new issue
Block a user