Closed dlech closed 2 years ago
The __enter__() method takes no arguments (other than self) and the __exit__() method takes 3 arguments (in addition to self), so METH_O (which indicates 1 argument in addition to self) was wrong in both cases.
__enter__()
__exit__()
METH_O
The
__enter__()
method takes no arguments (other than self) and the__exit__()
method takes 3 arguments (in addition to self), soMETH_O
(which indicates 1 argument in addition to self) was wrong in both cases.