<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/89621>89621</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            In py3.11 SBThread.frames says 'SBThread' object is not iterable
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          santhoshkumar-mani
      </td>
    </tr>
</table>

<pre>
    In py3.11 SBThread.frames says 'SBThread' object is not iterable, same works fine in 3.8 

Am using lldb version 8.0.1, is there any fix in recent versions ? i want to know if its worth upgrading 

```
```
File "/usr/local/llvm80/lib/python3.11/site-packages/lldb/_init_.py", line 10506, in get_thread_frames
    for frame in self:
TypeError: 'SBThread' object is not iterable
```
coming from here : /usr/local/llvm80/lib/python3.11/site-packages/lldb/{}init{}.py

```
 10503     def get_thread_frames(self):
  10504         '''An accessor function that returns a list() that contains all frames in a lldb.SBThread object.'''
  10505         frames = []
  10506         for frame in self:
  10507             frames.append(frame)
  10508         return frames   
```
```

Same code in 3.8 returns SBThread as list, but not in 3.11 

Swig is generating this file from lldb i guess

```
root# head -7 /usr/local/llvm80/lib/python3.11/site-packages/lldb/__init__.py
# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.1.1
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.
swig_version = (4, 1, 1)
Dont see any problem in swig 4.1.1 generated code, as it supports py3.11 : [https://swig.org/#:~:text=Python%203.9%2D3.11%20support%20added., ](https://swig.org/#:~:text=Python%203.9%2D3.11%20support%20added.)unless its a open defect

```
Or py3.11 [improvisation](https://docs.python.org/3.11/whatsnew/3.11.html#:~:text=Old%2Dstyle%20frame%20objects%20are%20now%20created%20only%20when%20requested%20by%20debuggers%20or%20by%20Python%20introspection%20functions%20such%20as%20sys._getframe()%20and%20inspect.currentframe(), isnt allowing frames to be returned ?, lldb manual is clear though SBThread.frames should return the frames 

https://lldb.llvm.org/python_api/lldb.SBThread.html#lldb.SBThread.frames
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVk2P2zYT_jX0ZbCCRNmWfPBhN379IqcU2KA9GpQ4ltilSJWkovjS314MKXu9zSYI0BiGPsjRfDzz8CGF96oziHu2eWKbw0pMobdu74UJvfX9yzQI9zAIo1aNlZf9RwPjpcyKAp6fPvcOhczOTgzowYuLB8ar6zjjFdjmT2wDKA_GBlABnWg0Mv4BvBgQZutePJyVQVAGyqwGlh9Y_piujwNMXpkOtJYNfEHnlTVQZ3lWkAflIfToEIS5wFl9JRcOWzThauuBlUdQMAsTIFh4MXYGdQYVPIUOPUxj54SkGPeB2TZf_u-9HpVGYJwzfpy8Y_yobSs03fWXoc7pQTWMH8dL6K0hqBg_ehXwYRTti-jQR1tJNidlVDhl4yX6-wCaoCjyTb6NFRroMJxChPOUYE45AACcrYM4RnYe9ZmVS_6fLyP-zznrWPn4kx15r9DWDoTM2dkBItDJ3X-vmlVPrDpQ6emJ6v8-_BGPkioGied3EOF1rJ7vbgBA_GYN1x_jVfo_GhBti94TdpNpAzEq9CKAwzA540GAVj4wXjO-SzOtNUEomtIaFq4rQ4ZaNtkV2wXY7BbqPpPNLZPle1YeIK23e7Ptq9l3e5ssK7j_JaeZGEc0kvE6vhMed1_UN-tU6TUTgJ_hfLo-U0KtlbfVegXtBoLwC3wfoJlCohiZFsWbBfY8q44o2KFBJwKxLPSKlEBj4ltc8gq6Cb3_ATectYHxEnoK_lD9Enae0qI8vbKSl_D5lt4sPIgp2EEE1QqtL9cqUEJzgec_Pv4fGK_7EEZPXeNHxo_zPGd-Vl1mXcf4Lnt1_Psia-usyIrb8Ov8wUYUB_GC0PbCdOhJyl7hmoxG7-Fip6RvM3GW3oRDkJawfYDBSnW-Kyf0mDJVJqA7ixaTM2V8IElPlpTx6aq7kbK8XlNvi-WyMOxgTQCPSYlHZxuNQyQutTkWdocR8Yc-Fx5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