Changeset 381 for pyyaml/tags/3.10


Ignore:
Timestamp:
05/30/11 00:20:22 (3 years ago)
Author:
xi
Message:

Dropped support for Python 2.3 and 2.4.

Location:
pyyaml/tags/3.10
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • pyyaml/tags/3.10

  • pyyaml/tags/3.10/CHANGES

    r379 r381  
    99* Clear cyclic references in the parser and the emitter 
    1010  (Thank to kristjan(at)ccpgames(dot)com). 
     11* Dropped support for Python 2.3 and 2.4. 
    1112 
    12133.09 (2009-08-31) 
  • pyyaml/tags/3.10/announcement.msg

    r379 r381  
    2020  (Thank to kristjan(at)ccpgames(dot)com). 
    2121* LibYAML bindings are rebuilt with the latest version of Cython. 
     22* Dropped support for Python 2.3 and 2.4; currently supported versions 
     23  are 2.5 to 3.2. 
    2224 
    2325 
  • pyyaml/tags/3.10/lib/yaml/constructor.py

    r379 r381  
    77 
    88import datetime 
    9  
    10 try: 
    11     set 
    12 except NameError: 
    13     from sets import Set as set 
    149 
    1510import binascii, re, sys, types 
     
    503498                    "expected non-empty name appended to the tag", mark) 
    504499        if u'.' in name: 
    505             # Python 2.4 only 
    506             #module_name, object_name = name.rsplit('.', 1) 
    507             items = name.split('.') 
    508             object_name = items.pop() 
    509             module_name = '.'.join(items) 
     500            module_name, object_name = name.rsplit('.', 1) 
    510501        else: 
    511502            module_name = '__builtin__' 
  • pyyaml/tags/3.10/lib/yaml/reader.py

    r323 r381  
    2121 
    2222import codecs, re 
    23  
    24 # Unfortunately, codec functions in Python 2.3 does not support the `finish` 
    25 # arguments, so we have to write our own wrappers. 
    26  
    27 try: 
    28     codecs.utf_8_decode('', 'strict', False) 
    29     from codecs import utf_8_decode, utf_16_le_decode, utf_16_be_decode 
    30  
    31 except TypeError: 
    32  
    33     def utf_16_le_decode(data, errors, finish=False): 
    34         if not finish and len(data) % 2 == 1: 
    35             data = data[:-1] 
    36         return codecs.utf_16_le_decode(data, errors) 
    37  
    38     def utf_16_be_decode(data, errors, finish=False): 
    39         if not finish and len(data) % 2 == 1: 
    40             data = data[:-1] 
    41         return codecs.utf_16_be_decode(data, errors) 
    42  
    43     def utf_8_decode(data, errors, finish=False): 
    44         if not finish: 
    45             # We are trying to remove a possible incomplete multibyte character 
    46             # from the suffix of the data. 
    47             # The first byte of a multi-byte sequence is in the range 0xc0 to 0xfd. 
    48             # All further bytes are in the range 0x80 to 0xbf. 
    49             # UTF-8 encoded UCS characters may be up to six bytes long. 
    50             count = 0 
    51             while count < 5 and count < len(data)   \ 
    52                     and '\x80' <= data[-count-1] <= '\xBF': 
    53                 count -= 1 
    54             if count < 5 and count < len(data)  \ 
    55                     and '\xC0' <= data[-count-1] <= '\xFD': 
    56                 data = data[:-count-1] 
    57         return codecs.utf_8_decode(data, errors) 
    5823 
    5924class ReaderError(YAMLError): 
     
    160125        if not isinstance(self.raw_buffer, unicode): 
    161126            if self.raw_buffer.startswith(codecs.BOM_UTF16_LE): 
    162                 self.raw_decode = utf_16_le_decode 
     127                self.raw_decode = codecs.utf_16_le_decode 
    163128                self.encoding = 'utf-16-le' 
    164129            elif self.raw_buffer.startswith(codecs.BOM_UTF16_BE): 
    165                 self.raw_decode = utf_16_be_decode 
     130                self.raw_decode = codecs.utf_16_be_decode 
    166131                self.encoding = 'utf-16-be' 
    167132            else: 
    168                 self.raw_decode = utf_8_decode 
     133                self.raw_decode = codecs.utf_8_decode 
    169134                self.encoding = 'utf-8' 
    170135        self.update(1) 
  • pyyaml/tags/3.10/lib/yaml/representer.py

    r328 r381  
    77 
    88import datetime 
    9  
    10 try: 
    11     set 
    12 except NameError: 
    13     from sets import Set as set 
    149 
    1510import sys, copy_reg, types 
Note: See TracChangeset for help on using the changeset viewer.