Changeset 333 for pyyaml/trunk/lib
- Timestamp:
- 12/29/08 23:02:04 (3 years ago)
- Location:
- pyyaml/trunk/lib/yaml
- Files:
-
- 3 modified
-
__init__.py (modified) (3 diffs)
-
cyaml.py (modified) (3 diffs)
-
emitter.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pyyaml/trunk/lib/yaml/__init__.py
r314 r333 92 92 getvalue = None 93 93 if stream is None: 94 try: 95 from cStringIO import StringIO 96 except ImportError: 97 from StringIO import StringIO 94 from StringIO import StringIO 98 95 stream = StringIO() 99 96 getvalue = stream.getvalue … … 116 113 getvalue = None 117 114 if stream is None: 118 try: 115 if encoding is None: 116 from StringIO import StringIO 117 else: 119 118 from cStringIO import StringIO 120 except ImportError:121 from StringIO import StringIO122 119 stream = StringIO() 123 120 getvalue = stream.getvalue … … 152 149 getvalue = None 153 150 if stream is None: 154 try: 151 if encoding is None: 152 from StringIO import StringIO 153 else: 155 154 from cStringIO import StringIO 156 except ImportError:157 from StringIO import StringIO158 155 stream = StringIO() 159 156 getvalue = stream.getvalue -
pyyaml/trunk/lib/yaml/cyaml.py
r223 r333 42 42 version=None, tags=None): 43 43 CEmitter.__init__(self, stream, canonical=canonical, 44 indent=indent, width=width, 44 indent=indent, width=width, encoding=encoding, 45 45 allow_unicode=allow_unicode, line_break=line_break, 46 46 explicit_start=explicit_start, explicit_end=explicit_end, … … 59 59 version=None, tags=None): 60 60 CEmitter.__init__(self, stream, canonical=canonical, 61 indent=indent, width=width, 61 indent=indent, width=width, encoding=encoding, 62 62 allow_unicode=allow_unicode, line_break=line_break, 63 63 explicit_start=explicit_start, explicit_end=explicit_end, … … 76 76 version=None, tags=None): 77 77 CEmitter.__init__(self, stream, canonical=canonical, 78 indent=indent, width=width, 78 indent=indent, width=width, encoding=encoding, 79 79 allow_unicode=allow_unicode, line_break=line_break, 80 80 explicit_start=explicit_start, explicit_end=explicit_end, -
pyyaml/trunk/lib/yaml/emitter.py
r328 r333 155 155 def expect_stream_start(self): 156 156 if isinstance(self.event, StreamStartEvent): 157 if self.event.encoding :157 if self.event.encoding and not getattr(self.stream, 'encoding', None): 158 158 self.encoding = self.event.encoding 159 159 self.write_stream_start()
