Skip to content

Commit 2aa58da

Browse files
committed
Fix building of docs on python3.
The Mock object which is used when building docs returned another Mock for all attributes except some special attributes. In Python 3, `__qualname__` (which must be a string) and `__annotations__` (which must be a dict) got added, which caused building docs to fail. Fixes #49.
1 parent 7af8faf commit 2aa58da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pytestqt/qt_compat.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ def __call__(self, *args, **kwargs):
9898
def __getattr__(cls, name):
9999
if name in ('__file__', '__path__'):
100100
return '/dev/null'
101-
elif name == '__name__':
101+
elif name in ('__name__', '__qualname__'):
102102
return name
103+
elif name == '__annotations__':
104+
return {}
103105
else:
104106
return Mock()
105107

0 commit comments

Comments
 (0)