Ignore:
Timestamp:
12/29/08 12:24:05 (5 years ago)
Author:
xi
Message:

Added basic support for Python 3 (Thanks idadesub(at)users(dot)sourceforge(dot)net).

Location:
pyyaml/trunk/lib3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • pyyaml/trunk/lib3/yaml/error.py

    r222 r328  
    22__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError'] 
    33 
    4 class Mark(object): 
     4class Mark: 
    55 
    66    def __init__(self, name, index, line, column, buffer, pointer): 
     
    1717        head = '' 
    1818        start = self.pointer 
    19         while start > 0 and self.buffer[start-1] not in u'\0\r\n\x85\u2028\u2029': 
     19        while start > 0 and self.buffer[start-1] not in '\0\r\n\x85\u2028\u2029': 
    2020            start -= 1 
    2121            if self.pointer-start > max_length/2-1: 
     
    2525        tail = '' 
    2626        end = self.pointer 
    27         while end < len(self.buffer) and self.buffer[end] not in u'\0\r\n\x85\u2028\u2029': 
     27        while end < len(self.buffer) and self.buffer[end] not in '\0\r\n\x85\u2028\u2029': 
    2828            end += 1 
    2929            if end-self.pointer > max_length/2-1: 
     
    3131                end -= 5 
    3232                break 
    33         snippet = self.buffer[start:end].encode('utf-8') 
     33        snippet = self.buffer[start:end] 
    3434        return ' '*indent + head + snippet + tail + '\n'  \ 
    3535                + ' '*(indent+self.pointer-start+len(head)) + '^' 
Note: See TracChangeset for help on using the changeset viewer.