Skip to content

Commit

Permalink
BF: Sub \\ for / BEFORE subbing \ for /
Browse files Browse the repository at this point in the history
  • Loading branch information
tparsons committed Mar 16, 2022
1 parent 5af70c4 commit e8218b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions psychopy/experiment/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ def __str__(self):
# If param is a path or pathlike use Path to make sure it's valid (with / not \)
isPathLike = bool(re.findall(r"[\\/](?!\W)", val))
if self.valType in ['file', 'table'] or (isPathLike and self.canBePath):
val = Path(val).as_posix()
val = val.replace("\\", "/").replace("//", "/")
val = val.replace("\\\\", "/")
val = val.replace("\\", "/")
# Hide escape char on escaped $ (other escaped chars are handled by wx but $ is unique to us)
val = re.sub(r"\\\$", "$", val)
# Replace line breaks with escaped line break character
Expand Down

0 comments on commit e8218b3

Please sign in to comment.