kota commited on
Commit
4717ac2
·
1 Parent(s): e60e568

fix psutil Process Not Found issue against deployment to huggingface

Browse files
Files changed (1) hide show
  1. pm4py/util/constants.py +4 -1
pm4py/util/constants.py CHANGED
@@ -146,7 +146,10 @@ if importlib.util.find_spec("psutil"):
146
  import psutil
147
 
148
  parent_pid = os.getppid()
149
- parent_name = str(psutil.Process(parent_pid).name())
 
 
 
150
 
151
  if "PBIDesktop" in parent_name:
152
  DEFAULT_GVIZ_VIEW = "matplotlib_view"
 
146
  import psutil
147
 
148
  parent_pid = os.getppid()
149
+ try:
150
+ parent_name = str(psutil.Process(parent_pid).name())
151
+ except psutil.NoSuchProcess:
152
+ parent_name = "UnknownProcess"
153
 
154
  if "PBIDesktop" in parent_name:
155
  DEFAULT_GVIZ_VIEW = "matplotlib_view"