Skip to content

Conversation

matthiaskramm
Copy link
Contributor

E.g. it's legal to call traceback.format_exception(None, None, None), in Python 2.

In particular, this change makes the following idiom type-check:

  import traceback
  import sys
  exc_type, exc_value, exc_traceback = sys.exc_info()
  traceback.format_exception(exc_type, exc_value, exc_traceback)

(sys.exc_info() returns Optional, for all three fields)

E.g. it's legal to call traceback.format_exception(None, None, None). In
particular, this change makes the following idiom type-check:
  import traceback
  import sys
  exc_type, exc_value, exc_traceback = sys.exc_info()
  traceback.format_exception(exc_type, exc_value, exc_traceback)
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK with me!

@gvanrossum gvanrossum merged commit 3638bc1 into master Aug 3, 2017
@gvanrossum gvanrossum deleted the traceback branch August 3, 2017 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants