aboutsummaryrefslogtreecommitdiffstats
path: root/yamlish.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2012-03-08 19:37:34 +0100
committerMatěj Cepl <mcepl@redhat.com>2012-03-08 19:37:34 +0100
commit8ac3747446cb2e8b0749e91cb6e6dbf318efe516 (patch)
tree2ec279889bc9e0365eb4ceccd2dbb3cbac1903b3 /yamlish.py
parentd9f2aa1f9d1066a168700c4e356db4f26772468a (diff)
downloadyamlish-8ac3747446cb2e8b0749e91cb6e6dbf318efe516.tar.gz
All tests succeeding!!!
Diffstat (limited to 'yamlish.py')
-rw-r--r--yamlish.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/yamlish.py b/yamlish.py
index 098e03d..fda3f74 100644
--- a/yamlish.py
+++ b/yamlish.py
@@ -172,10 +172,12 @@ def dump(source, destination):
if isinstance(destination, (str, unicode)):
with open(destination, "w") as outf:
dump(source, outf)
- elif isinstance(destination, file):
+ elif getattr(destination, "file"):
yaml.dump(source, destination, encoding="utf-8",
default_flow_style=False, canonical=False,
Dumper=yaml.SafeDumper)
+ else:
+ raise NameError
def dumps(source):
"""