summaryrefslogtreecommitdiff
path: root/morphlib/__init__.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-01-29 13:50:46 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-01-29 14:32:49 +0000
commite06eafcbf0784271f51c0936852d1e97c0ccce8b (patch)
treee7e914cd82348e79b7662e6bd06851a0100e7751 /morphlib/__init__.py
parent63f608d7c05095c16d1a8863b13c55634c0cae8b (diff)
downloadmorph-e06eafcbf0784271f51c0936852d1e97c0ccce8b.tar.gz
Make yaml be an optional dependency
This can go away when we have made a release with yaml in it, and its staging filler.
Diffstat (limited to 'morphlib/__init__.py')
-rw-r--r--morphlib/__init__.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/morphlib/__init__.py b/morphlib/__init__.py
index aba7a4d6..0f60642c 100644
--- a/morphlib/__init__.py
+++ b/morphlib/__init__.py
@@ -17,6 +17,19 @@
'''Baserock library.'''
+# Import yaml if available. This can go away once Baserock has made a
+# release that includes yaml (also in its staging filler).
+try:
+ import yaml
+except ImportError:
+ got_yaml = False
+ class YAMLError(Exception):
+ pass
+else:
+ got_yaml = True
+ YAMLError = yaml.YAMLError
+
+
import cliapp
import gitversion
@@ -57,6 +70,7 @@ import stagingarea
import stopwatch
import tempdir
import util
+
import yamlparse
import app # this needs to be last