From e06eafcbf0784271f51c0936852d1e97c0ccce8b Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 29 Jan 2013 13:50:46 +0000 Subject: Make yaml be an optional dependency This can go away when we have made a release with yaml in it, and its staging filler. --- morphlib/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'morphlib/__init__.py') 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 -- cgit v1.2.1