Skip to content

Commit 917cf55

Browse files
fix: replace bare except with except Exception (PEP 8 E722)
1 parent 27f4b43 commit 917cf55

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sagemaker-train/src/sagemaker/train/common_utils/finetune_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ def _resolve_model_and_name(model, sagemaker_session=None):
446446
try:
447447
import boto3
448448
region_name = boto3.Session().region_name or os.environ.get('AWS_DEFAULT_REGION')
449-
except:
449+
except Exception:
450450
pass
451451

452452
if isinstance(model, str):

sagemaker-train/src/sagemaker/train/evaluate/execution.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ def wait(
904904
if ipython is not None and 'IPKernelApp' in ipython.config:
905905
is_jupyter = True
906906
from IPython.display import display, HTML, clear_output
907-
except:
907+
except Exception:
908908
pass
909909

910910
if is_jupyter:
@@ -958,7 +958,7 @@ def wait(
958958
end = datetime.fromisoformat(step.end_time.replace('Z', '+00:00'))
959959
duration_seconds = (end - start).total_seconds()
960960
duration = f"{duration_seconds:.1f}s"
961-
except:
961+
except Exception:
962962
duration = "N/A"
963963
elif step.start_time:
964964
duration = "Running..."

0 commit comments

Comments
 (0)