seb-m / pyinotify

Monitoring filesystems events with inotify on Linux.
http://github.com/seb-m/pyinotify/wiki
MIT License
2.29k stars 379 forks source link

TypeError: unsupported operand type(s) for *: 'Mock' and 'int' #110

Closed decarlof closed 8 years ago

decarlof commented 8 years ago

all works fine but when running sphynx/autodocs on it I get an this error that prevents the docs to show any module importing pyinotify. Here is the full error:

from pyinotify import WatchManager, IN_DELETE, IN_CREATE, IN_CLOSE_WRITE, ProcessEvent, Notifier

File "build/bdist.linux-x86_64/egg/pyinotify.py", line 353, in File "build/bdist.linux-x86_64/egg/pyinotify.py", line 304, in create File "build/bdist.linux-x86_64/egg/pyinotify.py", line 290, in init TypeError: unsupported operand type(s) for *: 'Mock' and 'int'

decarlof commented 8 years ago

fixed editing the docs/conf.py added:

class Mock(MagicMock): @classmethod def getattr(cls, name): return Mock() def mul(self, other): return Mock() def rmul(self, other): return Mock() def pow(self, other): return Mock() def div(self, other): return Mock() class Mock(MagicMock): @classmethod def getattr(cls, name): return Mock() def mul(self, other): return Mock() def rmul(self, other): return Mock() def pow(self, other): return Mock() def div(self, other): return Mock()

see https://github.com/dkirkby/bossdata/issues/92