L
L
link_vrb2021-09-27 17:04:50
Python
link_vrb, 2021-09-27 17:04:50

How to fix AttributeError: __enter__ error?

Here is the part of my code where this error is:

while True:
        if choice != 0:
            with Thread(target=one) as onee:
                onee.start()
        for i in al:
            with Thread(target=some, args=(i[0], al, )) as pr2:
                pr2.start()

Outputs:

with Thread(target=one) as onee:
AttributeError: __enter__

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2021-09-27
@link_vrb

How to make a method suitable for with?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question