Skip to content

Commit e2b170a

Browse files
author
Kenneth Reitz
committed
Workaround for #1
1 parent d13e3ae commit e2b170a

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

smmap/mman.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,14 @@ def _destroy(self):
5252
if self._rlist is not None:
5353
# Actual client count, which doesn't include the reference kept by the manager, nor ours
5454
# as we are about to be deleted
55-
num_clients = self._rlist.client_count() - 2
56-
if num_clients == 0 and len(self._rlist) == 0:
57-
# Free all resources associated with the mapped file
58-
self._manager._fdict.pop(self._rlist.path_or_fd())
59-
#END remove regions list from manager
55+
try:
56+
num_clients = self._rlist.client_count() - 2
57+
if num_clients == 0 and len(self._rlist) == 0:
58+
# Free all resources associated with the mapped file
59+
self._manager._fdict.pop(self._rlist.path_or_fd())
60+
# END remove regions list from manager
61+
except TypeError:
62+
pass
6063
#END handle regions
6164

6265
def _copy_from(self, rhs):

0 commit comments

Comments
 (0)