diff --git a/CHANGES.txt b/CHANGES.txt index d8a02ad1f8..c59bb5720b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -21,12 +21,15 @@ Coming in build 307, as yet unreleased * `com/win32com/server/policy.py` * `win32/Lib/regutil.py` * `win32/scripts/VersionStamp/vssutil.py` -* Removed the following unused symbols. They were meant to be used as Exceptions, but were accidentally strings (#2270, @Avasam) +* Removed the following unused symbols. They were meant to be used as Exceptions, but were accidentally strings (#2270, #2269, @Avasam) * `pywin.debugger.debugger.error` * `pywin.framework.dlgappcore.error` * `win32com.server.policy.error` * `regutil.error` * `win32.scripts.VersionStamp.vssutil.error` + * `win32com.universal.com_error` + * `win32com.client.build.error` + * `win32com.client.genpy.error` * Add EnumDesktopWindows (#2219, @CristiFati) * Marked `exc_type` and `exc_traceback` in `win32comext.axscript.client.error.AXScriptException.__init__` as deprecated. (#2236 , @Avasam) They are now unused and all information is taken from the `exc_value` parameter. diff --git a/com/win32com/client/build.py b/com/win32com/client/build.py index 7428c13692..b75f218218 100644 --- a/com/win32com/client/build.py +++ b/com/win32com/client/build.py @@ -29,8 +29,6 @@ # always render the string perfectly - so just punt and fall-back to a repr() _makeDocString = repr -error = "PythonCOM.Client.Build error" - class NotSupportedException(Exception): pass # Raised when we can't support a param type. diff --git a/com/win32com/client/genpy.py b/com/win32com/client/genpy.py index 7a4d061f6f..6c3e7dc7f1 100644 --- a/com/win32com/client/genpy.py +++ b/com/win32com/client/genpy.py @@ -22,7 +22,6 @@ from . import build -error = "makepy.error" makepy_version = "0.5.01" # Written to generated file. GEN_FULL = "full" diff --git a/com/win32com/client/tlbrowse.py b/com/win32com/client/tlbrowse.py index 1a8d64909b..ceeabe8ec4 100644 --- a/com/win32com/client/tlbrowse.py +++ b/com/win32com/client/tlbrowse.py @@ -10,7 +10,7 @@ class TLBrowserException(Exception): "TypeLib browser internal error" -error = TLBrowserException +error = TLBrowserException # Re-exported alias FRAMEDLG_STD = win32con.WS_CAPTION | win32con.WS_SYSMENU SS_STD = win32con.WS_CHILD | win32con.WS_VISIBLE diff --git a/com/win32com/universal.py b/com/win32com/universal.py index 14e0aa0882..1063680d21 100644 --- a/com/win32com/universal.py +++ b/com/win32com/universal.py @@ -5,8 +5,7 @@ import pythoncom from win32com.client import gencache -com_error = pythoncom.com_error -_univgw = pythoncom._univgw +com_error = pythoncom.com_error # Re-exported alias def RegisterInterfaces(typelibGUID, lcid, major, minor, interface_names=None): @@ -86,15 +85,15 @@ def RegisterInterfaces(typelibGUID, lcid, major, minor, interface_names=None): def _doCreateVTable(iid, interface_name, is_dispatch, method_defs): defn = Definition(iid, is_dispatch, method_defs) - vtbl = _univgw.CreateVTable(defn, is_dispatch) - _univgw.RegisterVTable(vtbl, iid, interface_name) + vtbl = pythoncom._univgw.CreateVTable(defn, is_dispatch) + pythoncom._univgw.RegisterVTable(vtbl, iid, interface_name) def _CalcTypeSize(typeTuple): t = typeTuple[0] if t & (pythoncom.VT_BYREF | pythoncom.VT_ARRAY): # It's a pointer. - cb = _univgw.SizeOfVT(pythoncom.VT_PTR)[1] + cb = pythoncom._univgw.SizeOfVT(pythoncom.VT_PTR)[1] elif t == pythoncom.VT_RECORD: # Just because a type library uses records doesn't mean the user # is trying to. We need to better place to warn about this, but it @@ -104,10 +103,10 @@ def _CalcTypeSize(typeTuple): # warnings.warn("warning: records are known to not work for vtable interfaces") # except ImportError: # print("warning: records are known to not work for vtable interfaces") - cb = _univgw.SizeOfVT(pythoncom.VT_PTR)[1] + cb = pythoncom._univgw.SizeOfVT(pythoncom.VT_PTR)[1] # cb = typeInfo.GetTypeAttr().cbSizeInstance else: - cb = _univgw.SizeOfVT(t)[1] + cb = pythoncom._univgw.SizeOfVT(t)[1] return cb @@ -191,8 +190,8 @@ def dispatch( ob, index, argPtr, - ReadFromInTuple=_univgw.ReadFromInTuple, - WriteFromOutTuple=_univgw.WriteFromOutTuple, + ReadFromInTuple=pythoncom._univgw.ReadFromInTuple, + WriteFromOutTuple=pythoncom._univgw.WriteFromOutTuple, ): "Dispatch a call to an interface method." meth = self._methods[index] diff --git a/win32/Lib/sspi.py b/win32/Lib/sspi.py index 803559fba9..5b62913543 100644 --- a/win32/Lib/sspi.py +++ b/win32/Lib/sspi.py @@ -17,7 +17,7 @@ import sspicon import win32security -error = win32security.error +error = win32security.error # Re-exported alias class _BaseAuth: diff --git a/win32/Lib/win32evtlogutil.py b/win32/Lib/win32evtlogutil.py index f7b67a553c..05cabe2b81 100644 --- a/win32/Lib/win32evtlogutil.py +++ b/win32/Lib/win32evtlogutil.py @@ -6,8 +6,7 @@ import win32evtlog import winerror -error = win32api.error # The error the evtlog module raises. - +error = win32api.error # Re-exported alias (The error the evtlog module raises). langid = win32api.MAKELANGID(win32con.LANG_NEUTRAL, win32con.SUBLANG_NEUTRAL) diff --git a/win32/Lib/win32pdhutil.py b/win32/Lib/win32pdhutil.py index 4b733ac3fb..bc966412f3 100644 --- a/win32/Lib/win32pdhutil.py +++ b/win32/Lib/win32pdhutil.py @@ -24,7 +24,7 @@ import win32pdh -error = win32pdh.error +error = win32pdh.error # Re-exported alias # Handle some localization issues. # see http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q287/1/59.asp&NoWebContent=1 diff --git a/win32/Lib/win32serviceutil.py b/win32/Lib/win32serviceutil.py index 2284536c3a..5601e13eb1 100644 --- a/win32/Lib/win32serviceutil.py +++ b/win32/Lib/win32serviceutil.py @@ -17,7 +17,7 @@ import win32service import winerror -error = RuntimeError +error = RuntimeError # Re-exported alias # Returns the full path to an executable for hosting a Python service - typically