# HG changeset patch # User Chris Eldredge # Date 1381162909 -3600 # Node ID 26d2baa983a934f89c7af4a8d44d74f2901f8a67 # Parent ade5266185db547798cc32d380ea6f17ec5cac4a Don't completely break unrelated hg commands when markdown can't be loaded. diff -r ade5266185db -r 26d2baa983a9 __init__.py --- a/__init__.py Sun Oct 06 17:36:21 2013 +0700 +++ b/__init__.py Mon Oct 07 17:21:49 2013 +0100 @@ -196,11 +196,13 @@ try: from markdown import Markdown - global Markdown except ImportError: dir = os.path.dirname(os.path.realpath(__file__)) md = ui.config("web", "markdown.egg", "Markdown-2.3.1") ui.debug("Markdown not found search for egg in local dir %s for %s.zip\n" % (dir, md)) sys.path.append(os.path.join(dir, "%s.zip\%s" % (md, md))) - from markdown import Markdown - global Markdown + try: + from markdown import Markdown + except ImportError: + ui.error("Unable to locate markdown in path %s" % sys.path) + global Markdown