-
Notifications
You must be signed in to change notification settings - Fork 13
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
NewPyBuildSupport: Add build matrix entries for 3.11 and 3.12 #77
Conversation
Signed-off-by: Gabe Goodhart <[email protected]>
Signed-off-by: Gabe Goodhart <[email protected]>
Signed-off-by: Gabe Goodhart <[email protected]>
# If all else fails, we'll just return a sentinel string. This will fail to | ||
# match in the below check for builtin modules | ||
return "BADPATH" # pragma: no cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to get rid of # pragma: no cover
here with a little inlining
def _get_exception_table(dis_lines: List[str]) -> Dict[int, int]: | ||
"""For 3.11+ exception handling, parse the Exception Table""" | ||
table_start = [i for i, line in enumerate(dis_lines) if line == "ExceptionTable:"] | ||
assert len(table_start) <= 1, "Found multiple exception tables!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not encountered a case where this is larger than 1 and can't imagine a circumstance under which it would be, but I haven't exhaustively read the spec either, so if this ever trips, we may need to investigate this further.
Signed-off-by: Gabe Goodhart <[email protected]>
@@ -377,7 +413,7 @@ def _figure_out_import( | |||
log.debug3("Module file: %s", getattr(mod, "__file__", None)) | |||
if not import_name: | |||
import_name = root_mod_name | |||
else: | |||
elif root_mod_name: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change showed up as I was trying to understand why some modules were not identified as optional. I believe this was a bug since the resulting name could be ".foobar"
which would not show up in sys.modules
when "foobar"
would.
@@ -419,15 +455,23 @@ def _get_imports(mod: ModuleType) -> Tuple[Set[ModuleType], Set[ModuleType]]: | |||
open_import = False | |||
open_tries = set() | |||
log.debug4("Byte Code:") | |||
for line in bcode.dis().split("\n"): | |||
dis_lines = bcode.dis().split("\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love the need to iterate the lines twice, but this should be a pretty small performance penalty
No description provided.