Skip to content

Commit

Permalink
Fix Python3 (Windows) compatibility (MarlinFirmware#15597)
Browse files Browse the repository at this point in the history
  • Loading branch information
p3p authored Oct 18, 2019
1 parent 725ec68 commit 11f1392
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def print_error(e):
#
import subprocess
# typical result (string): 'Drives: C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
driveStr = subprocess.check_output("fsutil fsinfo drives")
driveStr = subprocess.check_output("fsutil fsinfo drives").decode('utf8')
# typical result (string): 'C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
driveStr = driveStr.strip().lstrip('Drives: ')
# typical result (array of stings): ['C:\\', 'D:\\', 'E:\\', 'F:\\',
Expand All @@ -44,7 +44,7 @@ def print_error(e):
for drive in drives:
final_drive_name = drive.strip().rstrip('\\') # typical result (string): 'C:'
try:
volume_info = subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT)
volume_info = subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT).decode('utf8')
except Exception as e:
continue
else:
Expand Down

0 comments on commit 11f1392

Please sign in to comment.