Ignore:
Timestamp:
12/29/08 23:02:04 (6 years ago)
Author:
xi
Message:

Handle the encoding of input and output streams in a uniform way.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyyaml/trunk/lib/yaml/__init__.py

    r314 r333  
    9292    getvalue = None 
    9393    if stream is None: 
    94         try: 
    95             from cStringIO import StringIO 
    96         except ImportError: 
    97             from StringIO import StringIO 
     94        from StringIO import StringIO 
    9895        stream = StringIO() 
    9996        getvalue = stream.getvalue 
     
    116113    getvalue = None 
    117114    if stream is None: 
    118         try: 
     115        if encoding is None: 
     116            from StringIO import StringIO 
     117        else: 
    119118            from cStringIO import StringIO 
    120         except ImportError: 
    121             from StringIO import StringIO 
    122119        stream = StringIO() 
    123120        getvalue = stream.getvalue 
     
    152149    getvalue = None 
    153150    if stream is None: 
    154         try: 
     151        if encoding is None: 
     152            from StringIO import StringIO 
     153        else: 
    155154            from cStringIO import StringIO 
    156         except ImportError: 
    157             from StringIO import StringIO 
    158155        stream = StringIO() 
    159156        getvalue = stream.getvalue 
Note: See TracChangeset for help on using the changeset viewer.