break once success

This commit is contained in:
limkokhole
2020-06-24 18:11:43 +08:00
parent d7073c7b3c
commit a01d85dfec

View File

@@ -370,6 +370,7 @@ def get_max_path(arg_cut, fs_f_max, fpart_excluded_immutable, immutable):
for gostan in range(space_remains, space_remains - 4, -1): for gostan in range(space_remains, space_remains - 4, -1):
try: try:
fpart_excluded_immutable = fpart_excluded_immutable.encode('utf-8')[: gostan ].decode('utf-8') fpart_excluded_immutable = fpart_excluded_immutable.encode('utf-8')[: gostan ].decode('utf-8')
break # No break still same result, but waste
except UnicodeDecodeError: except UnicodeDecodeError:
pass #print('Calm down, this is normal: ' + str(gostan) + ' f: ' + fpart_excluded_immutable) pass #print('Calm down, this is normal: ' + str(gostan) + ' f: ' + fpart_excluded_immutable)
#print('after f: ' + fpart_excluded_immutable) #print('after f: ' + fpart_excluded_immutable)