From b8b13dbe98b295d4c2f6658da43059ed6a87688b Mon Sep 17 00:00:00 2001 From: Jaeyeong Yang Date: Thu, 16 Sep 2021 21:55:15 +0900 Subject: [PATCH] Fix the getuid issue (#140) --- Python/hbayesdm/base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Python/hbayesdm/base.py b/Python/hbayesdm/base.py index a564c436..73b342b7 100644 --- a/Python/hbayesdm/base.py +++ b/Python/hbayesdm/base.py @@ -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)