Use raise exc from None to remove parent exceptions.
raise exc from None
Example:
try: # ... except Exception ex1: # ... try: # ... except Exception ex2: # ... raise ex1 from None
Related:
References: