From c2396d34109f8fc628e2d06e5335229afe5b5f37 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 11 Aug 2012 00:22:51 -0400 Subject: [PATCH] Cheat to make the bot import correctly without PyYAML installed. --- earwigbot/config/ordered_yaml.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/earwigbot/config/ordered_yaml.py b/earwigbot/config/ordered_yaml.py index 33158ab..c95f7ee 100644 --- a/earwigbot/config/ordered_yaml.py +++ b/earwigbot/config/ordered_yaml.py @@ -31,12 +31,13 @@ from collections import OrderedDict try: import yaml + from yaml import Loader, SafeDumper except ImportError: - yaml = None + yaml = Loader = SafeDumper = None __all__ = ["OrderedLoader", "OrderedDumper"] -class OrderedLoader(yaml.Loader): +class OrderedLoader(Loader): """A YAML loader that loads mappings into ordered dictionaries.""" def __init__(self, *args, **kwargs): @@ -74,7 +75,7 @@ class OrderedLoader(yaml.Loader): return mapping -class OrderedDumper(yaml.SafeDumper): +class OrderedDumper(SafeDumper): """A YAML dumper that dumps ordered dictionaries into mappings.""" def __init__(self, *args, **kwargs):