Skip to content

Commit

Permalink
Patch for pytac version on pypi.
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Nicholls committed Apr 16, 2019
1 parent 3d371e9 commit cefb124
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,18 @@

# If we cannot import pytac or at then mock them. This is a temporary fix
# because at is not on pypi.
MOCK_MODULES = []
class FieldException(Exception):
pass

import pytac
pytac.exceptions.FieldException = FieldException

class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()

try:
import pytac
except ImportError:
MOCK_MODULES.append('pytac')
try:
import at
except ImportError:
MOCK_MODULES.append('at')

sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
sys.modules.update(('at', Mock()))

# -- Project information -----------------------------------------------------

Expand Down

0 comments on commit cefb124

Please sign in to comment.