Skip to content

Commit

Permalink
Merge pull request #791 from slaclab/fix_find_file
Browse files Browse the repository at this point in the history
Fix a path issue with windows
  • Loading branch information
jbellister-slac authored Feb 9, 2022
2 parents 1696af6 + a435c81 commit e323f98
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pydm/utilities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,14 @@ def find_file(fname, base_path=None, mode=None, extra_path=None):
if pydm_search_path:
x_path.extend(pydm_search_path.split(os.pathsep))

# f_ext = ''.join(_extensions(fname))

for idx, path in enumerate(x_path):
x_path[idx] = os.path.expanduser(os.path.expandvars(path))

root, ext = os.path.splitext(fname)

# loop through the possible screen file extensions
for e in _screen_file_extensions(ext):
# file_path = which(f"{root}{e}", mode=mode, pathext=f_ext, extra_path=x_path)
file_path = which(f"{root}{e}", mode=mode, extra_path=x_path)
file_path = which(str(root) + str(e), mode=mode, pathext=e, extra_path=x_path)
if file_path is not None:
break # pick the first screen file found

Expand Down

0 comments on commit e323f98

Please sign in to comment.