From 8799837d75744c697f7dee994b327632c27cbfe4 Mon Sep 17 00:00:00 2001
From: GHGiampy <83699429+GHGiampy@users.noreply.github.com>
Date: Sat, 5 Feb 2022 17:23:44 +0100
Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Clean=20up=20upload.py=20(#23679?=
 =?UTF-8?q?)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 buildroot/share/scripts/upload.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/buildroot/share/scripts/upload.py b/buildroot/share/scripts/upload.py
index f6b25396ad..c7730d8f29 100644
--- a/buildroot/share/scripts/upload.py
+++ b/buildroot/share/scripts/upload.py
@@ -142,7 +142,7 @@ def Upload(source, target, env):
     upload_port = _GetUploadPort(env)               # Serial port to use
 
     # Set local upload params
-    upload_firmware_target_name = os.path.basename(upload_firmware_source_name)     # WARNING! Need rework on "binary_stream" to allow filename > 8.3
+    upload_firmware_target_name = os.path.basename(upload_firmware_source_name)
                                                     # Target firmware filename
     upload_timeout = 1000                           # Communication timout, lossy/slow connections need higher values
     upload_blocksize = 512                          # Transfer block size. 512 = Autodetect
@@ -154,11 +154,11 @@ def Upload(source, target, env):
     # Set local upload params based on board type to change script behavior
     # "upload_delete_old_bins": delete all *.bin files in the root of SD Card
     upload_delete_old_bins = marlin_motherboard in ['BOARD_CREALITY_V4',   'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V422', 'BOARD_CREALITY_V423',
-                                                    'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452',  'BOARD_CREALITY_V453',
+                                                    'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431',  'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453',
                                                     'BOARD_CREALITY_V24S1']
     # "upload_random_name": generate a random 8.3 firmware filename to upload
     upload_random_filename = marlin_motherboard in ['BOARD_CREALITY_V4',   'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V422', 'BOARD_CREALITY_V423',
-                                                    'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452',  'BOARD_CREALITY_V453',
+                                                    'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431',  'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453',
                                                     'BOARD_CREALITY_V24S1'] and not marlin_long_filename_host_support
 
     try:
@@ -258,7 +258,7 @@ def Upload(source, target, env):
             print('Trigger firmware update...')
             protocol.send_ascii('M997', True)
 
-        protocol: protocol.shutdown()
+        protocol.shutdown()
         print('Firmware update completed')
 
     except KeyboardInterrupt: