Skip to content

Commit

Permalink
Fix broken reset and tearDown in pypy3
Browse files Browse the repository at this point in the history
There appear to be some minor differences in the CPython and Pypy3 implementations of del. 
Use delattr to ensure that hasattr will see the attributes as deleted.
  • Loading branch information
slyngshede committed Aug 27, 2022
1 parent 00eaedd commit e5959b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tests/t_ldapobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,12 +658,12 @@ def _open_ldap_conn(self, who=None, cred=None, **kwargs):

def tearDown(self):
self._sock.close()
del self._sock
delattr(self, '_sock')
super().tearDown()

def reset_connection(self):
self._sock.close()
del self._sock
delattr(self, '_sock')
super(Test03_SimpleLDAPObjectWithFileno, self).reset_connection()


Expand Down

0 comments on commit e5959b3

Please sign in to comment.