You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/09/02 13:31:35 UTC

[GitHub] [beam] yeandy commented on a diff in pull request #22940: Python 3.10 Fix jump offsets opcodes

yeandy commented on code in PR #22940:
URL: https://github.com/apache/beam/pull/22940#discussion_r961682955


##########
sdks/python/apache_beam/typehints/trivial_inference.py:
##########
@@ -376,6 +376,14 @@ def infer_return_type_func(f, input_types, debug=False, depth=0):
   inst_size = 2
   opt_arg_size = 0
 
+  # Python 3.10: bpo-27129 changes jump offsets to use instruction offsets,
+  # not byte offsets. The offsets were halved (16 bits fro instructions vs 8
+  # bits for bytes), so we have to double the value of arg.
+  if (sys.version_info.major, sys.version_info.minor) == (3, 10):

Review Comment:
   Yes, I'll change it. When I wrote ` == (3, 10)`, I was thinking of `GEN_START` which was added in 3.10, but then removed in 3.11. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org