summaryrefslogtreecommitdiff
path: root/ext/_yaml.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'ext/_yaml.pyx')
-rw-r--r--ext/_yaml.pyx2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/_yaml.pyx b/ext/_yaml.pyx
index ac56b5f..df19492 100644
--- a/ext/_yaml.pyx
+++ b/ext/_yaml.pyx
@@ -955,7 +955,7 @@ cdef class CEmitter:
self.stream = stream
self.dump_unicode = 0
if PY_MAJOR_VERSION < 3:
- if hasattr(stream, 'encoding'):
+ if getattr3(stream, 'encoding', None):
self.dump_unicode = 1
else:
if hasattr(stream, u'encoding'):