반응형 중첩오류1 During handling of the above exception, another exception occurred During handling of the above exception, another exception occurred 파이썬에서 예외를 처리하는 동안 새로운 예외가 발생했을 때 나타나는 에러입니다.한마디로 중첩예외입니다. 1. 문제의 주요 원인예외 처리 중 추가 예외 발생예외를 처리하는 except 블록에서 새로운 예외가 발생하는 경우입니다.예:위 코드에서는 ZeroDivisionError를 처리하려다 undefined_variable이라는 정의되지 않은 변수를 참조해 NameError가 추가로 발생합니다.try: x = 1 / 0 # ZeroDivisionError 발생 except ZeroDivisionError as e: print(undefined_variable) # NameError 발생리소.. 2024. 12. 22. 이전 1 다음 반응형