Created
August 26, 2013 12:22
-
-
Save zhenyi2697/6340878 to your computer and use it in GitHub Desktop.
Python: markdown not found error handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try: | |
| from markdown import markdown | |
| except ImportError: | |
| class MarkdownNotFound(Exception): | |
| def __str__(self): | |
| return "Markdown is not installed!" | |
| raise MarkdownNotFound |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment