Andrew Suciu  committed 8671dbe

cleaned up mmap ValueError exception

  • Participants
  • Parent commits 03b38d0
  • Branches mmap_fix

Comments (0)

Files changed (1)

File src/whoosh/filedb/

                 # If we got an error because there wasn't enough memory to
                 # open the map, ignore it and fall through, we'll just use the
                 # (slower) "sub-file" implementation
-                if e.__class__.__name__ = 'ValueError' or e.errno == errno.ENOMEM:
+                # We may also catch the same error as a ValueError because mmap is too large
+                if isinstance(e, ValueError) or e.errno == errno.ENOMEM:
     def __repr__(self):