Commits

Anonymous committed 8671dbe

cleaned up mmap ValueError exception

Comments (0)

Files changed (1)

src/whoosh/filedb/compound.py

                 # 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:
                     pass
 
     def __repr__(self):