Permalink
Browse files

Workaround for #1

  • Loading branch information...
1 parent d13e3ae commit e2b170a80462255dcc2003380db3547f55d8f14d @kennethreitz kennethreitz committed Jul 8, 2011
Showing with 8 additions and 5 deletions.
  1. +8 −5 smmap/mman.py
View
@@ -52,11 +52,14 @@ def _destroy(self):
if self._rlist is not None:
# Actual client count, which doesn't include the reference kept by the manager, nor ours
# as we are about to be deleted
- num_clients = self._rlist.client_count() - 2
- if num_clients == 0 and len(self._rlist) == 0:
- # Free all resources associated with the mapped file
- self._manager._fdict.pop(self._rlist.path_or_fd())
- #END remove regions list from manager
+ try:
+ num_clients = self._rlist.client_count() - 2
+ if num_clients == 0 and len(self._rlist) == 0:
+ # Free all resources associated with the mapped file
+ self._manager._fdict.pop(self._rlist.path_or_fd())
+ # END remove regions list from manager
+ except TypeError:
+ pass
#END handle regions
def _copy_from(self, rhs):

0 comments on commit e2b170a

Please sign in to comment.