-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The extract_ast.py tool didn't properly catch unhandled C types, and when that happened a Node attribute could be associated to the wrong Python type, the one determined from a previous inspected attribute.
- Loading branch information
Showing
1 changed file
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# :Created: sab 27 feb 2021, 19:47:11 | ||
# :Author: Lele Gaifax <[email protected]> | ||
# :License: GNU General Public License version 3 or later | ||
# :Copyright: © 2021, 2022 Lele Gaifax | ||
# :Copyright: © 2021, 2022, 2023 Lele Gaifax | ||
# | ||
|
||
from datetime import date | ||
|
@@ -1020,9 +1020,13 @@ def adaptor(value): | |
if ctype.endswith('*'): | ||
ptype = G.get(ctype[:-1]) | ||
if ptype is None: | ||
raise NotImplementedError(f'unknown {ctype!r}') from None | ||
aname = f'{cls.__name__}.{attr}' | ||
raise NotImplementedError(f'Unhandled C type of {aname}: {ctype}') | ||
else: | ||
ptype = (dict, ptype) | ||
else: | ||
aname = f'{cls.__name__}.{attr}' | ||
raise NotImplementedError(f'Unhandled C type of {aname}: {ctype}') | ||
slots[attr] = SlotTypeInfo(ctype, ptype, adaptor) | ||
|