Skip to content

Commit d8b2df5

Browse files
authored
Copy code.co_qualname on Python >= 3.11 (#423)
As of the changes to `linecache` in python/cpython#117174, logging tracebacks requires code objects to have a `co_qualname` attribute, which is true for native Python code objects as of 3.11. Adjust billiard's emulation of them to match. Spotted by pagure's tests in https://bugs.debian.org/1101621; analysis and patch by Rebecca N. Palmer <[email protected]>.
1 parent c88a0b7 commit d8b2df5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

billiard/einfo.py

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def __init__(self, code):
2323
self.co_stacksize = code.co_stacksize
2424
self.co_varnames = ()
2525
if sys.version_info >= (3, 11):
26+
self.co_qualname = code.co_qualname
2627
self._co_positions = list(code.co_positions())
2728

2829
if sys.version_info >= (3, 11):

0 commit comments

Comments
 (0)