summaryrefslogtreecommitdiff
path: root/tools/pyboard.py
diff options
context:
space:
mode:
authorWind-stormger <storm-wind@foxmail.com>2022-08-30 11:30:12 +0800
committerDamien George <damien@micropython.org>2022-09-13 13:28:39 +1000
commit57fd66b80f8352e4859e6b71536b6083f9d7279c (patch)
tree31211200409f88ca8cbf9ac07c14e256c612013e /tools/pyboard.py
parent2d4e7e99bfcfaaed252564f9498176ca3ad88fee (diff)
tools/pyboard.py: Support Windows pathname separators.
Addresses issue #9132.
Diffstat (limited to 'tools/pyboard.py')
-rwxr-xr-xtools/pyboard.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/pyboard.py b/tools/pyboard.py
index 436bc5ab1..60cc06508 100755
--- a/tools/pyboard.py
+++ b/tools/pyboard.py
@@ -582,12 +582,12 @@ def filesystem_command(pyb, args, progress_callback=None, verbose=False):
return src
def fname_cp_dest(src, dest):
- src = src.rsplit("/", 1)[-1]
+ _, src = os.path.split(src)
if dest is None or dest == "":
dest = src
elif dest == ".":
- dest = "./" + src
- elif dest.endswith("/"):
+ dest = os.path.join(".", src)
+ elif dest.endswith(os.path.sep):
dest += src
return dest