Skip to content

Commit

Permalink
fix python api on casper (#3364)
Browse files Browse the repository at this point in the history
  • Loading branch information
StasJ committed Mar 28, 2023
1 parent 159e53d commit a8b3e7a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/pythonapi/vapor/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@

condaPaths = [os.getenv('CONDA_PREFIX', "/")]

def PathExists(path):
try:
return path.exists()
except PermissionError:
return False

roots = sourcePaths + installPaths + modulePaths + condaPaths
allRoots = roots.copy()
roots = map(Path, roots)
roots = filter(Path.exists, roots)
roots = filter(PathExists, roots)
roots = [*roots]

# print("Resource Roots:\n\t" + "\n\t".join(map(str, roots)))
Expand Down Expand Up @@ -99,4 +105,4 @@ def IsRunningFromIPython():
__IPYTHON__
return True
except NameError:
return False
return False

0 comments on commit a8b3e7a

Please sign in to comment.