Skip to content

Commit e5959b3

Browse files
authored
Fix broken reset and tearDown in pypy3
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.
1 parent 00eaedd commit e5959b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tests/t_ldapobject.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,12 +658,12 @@ def _open_ldap_conn(self, who=None, cred=None, **kwargs):
658658

659659
def tearDown(self):
660660
self._sock.close()
661-
del self._sock
661+
delattr(self, '_sock')
662662
super().tearDown()
663663

664664
def reset_connection(self):
665665
self._sock.close()
666-
del self._sock
666+
delattr(self, '_sock')
667667
super(Test03_SimpleLDAPObjectWithFileno, self).reset_connection()
668668

669669

0 commit comments

Comments
 (0)