Python Error: AttributeError: __enter__ [duplicate]
问题 This question already has answers here : Object becomes None when using a context manager (3 answers) Closed last year . I receive the attribute error when I try to run the code. with ParamExample(URI) as pe: with MotionCommander(pe, default_height=0.3)as mc: This is where the error occurs. Traceback (most recent call last): File "test44.py", line 156, in <module> with ParamExample(URI) as pe: AttributeError: __enter__ That is the traceback that I receive in my terminal. If you need to see