Skip to content

Commit

Permalink
Fix the getuid issue (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeyeongYang committed Sep 16, 2021
1 parent 7db4b8e commit b8b13db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Python/hbayesdm/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,12 @@ def _designate_stan_model(self, model: str) -> StanModel:
"""
model_path = str(PATH_STAN / (model + '.stan'))
tempdir = Path(tempfile.gettempdir())
uid = os.getuid()

if getattr(os, 'getuid', None) is None:
uid = 'windows'
else:
uid = os.getuid()

cache_file = tempdir / (
'cached-hBayesDM_model-%s-pystan_%s_user-%d.pkl' %
(model, _pystan_version, uid)
Expand Down

0 comments on commit b8b13db

Please sign in to comment.