Skip to content

This is for those who have Python updated from 3.10#5

Open
Sota4Ever wants to merge 1 commit intonelenkov:masterfrom
Sota4Ever:patch-1
Open

This is for those who have Python updated from 3.10#5
Sota4Ever wants to merge 1 commit intonelenkov:masterfrom
Sota4Ever:patch-1

Conversation

@Sota4Ever
Copy link

No description provided.

@kirya-dev
Copy link

This fix works with Python 3.9

import io

def frombits(bits) -> io.BytesIO:
    chars = bytearray()
    for b in range(len(bits) // 8):
        byte = bits[b * 8:(b + 1) * 8]
        chars.append(int(''.join([str(bit) for bit in byte]), 2))
    return io.BytesIO(chars)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants