Skip to content

Commit

Permalink
Improve error message on non Win (enthought#423)
Browse files Browse the repository at this point in the history
* Improve COM error message

* Drop Py2 stuff

* Remove dot

* Remove empty line

(cherry picked from commit 18cafb0)
  • Loading branch information
CristiFati authored and junkmd committed Feb 3, 2024
1 parent 9d3906e commit 03c244b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion comtypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
import atexit
from ctypes import *
from ctypes import _SimpleCData
from _ctypes import COMError
try:
from _ctypes import COMError
except ImportError as e:
msg = "\n".join((
"COM technology not available (maybe it's the wrong platform).",
"Note that COM is only supported on Windows.",
"For more details, please check: "
"https://learn.microsoft.com/en-us/windows/win32/com"))
raise ImportError(msg) from e
import logging
import os
import sys
Expand Down

0 comments on commit 03c244b

Please sign in to comment.