8000 gh-126615: Make `COMError` public and add to `ctypes` doc. by junkmd · Pull Request #126686 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-126615: Make COMError public and add to ctypes doc. #126686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Nov 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add the dot to make the reflink.
  • Loading branch information
junkmd committed Nov 16, 2024
commit dafb5b225a451adfa8763575fde7b77dcfa8f334
2 changes: 1 addition & 1 deletion Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,7 @@ different ways, depending on the type and number of the parameters in the call:
the interface identifier which is used in extended error reporting.

If *iid* is not specified, a :exc:`WindowsError` is raised if the COM method
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WindowsError is now an alias of OSError.

Suggested change
If *iid* is not specified, a :exc:`WindowsError` is raised if the COM method
If *iid* is not specified, an :exc:`OSError` is raised if the COM method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

Thank you.

call fails. If *iid* is specified, a :exc:`COMError` is raised instead.
call fails. If *iid* is specified, a :exc:`.COMError` is raised instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think (but I'm not 100% sure) that .COMError means Sphinx will search all namespaces, not just ctypes, for a COMError. So it would be better to use ctypes.COMError explicitly:

Suggested change
call fails. If *iid* is specified, a :exc:`.COMError` is raised instead.
call fails. If *iid* is specified, a :exc:`~ctypes.COMError` is raised instead.


COM methods use a special calling convention: They require a pointer to
the COM interface as first argument, in addition to those parameters that
Expand Down
0