Ignore:
Timestamp:
12/29/08 13:11:08 (6 years ago)
Author:
xi
Message:

Fixed the remaining Python 3 compatibility issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyyaml/trunk/tests3/test_constructor.py

    r328 r329  
    77 
    88def execute(code): 
     9    global value 
    910    exec(code) 
    1011    return value 
     
    1213def _make_objects(): 
    1314    global MyLoader, MyDumper, MyTestClass1, MyTestClass2, MyTestClass3, YAMLObject1, YAMLObject2,  \ 
    14             AnObject, AnInstance, AState, ACustomState, InitArgs, InitArgsWithState,    \ 
    15             NewArgs, NewArgsWithState, Reduce, ReduceWithState, MyInt, MyList, MyDict,  \ 
    16             FixedOffset, execute 
     15            AnObject, AnInstance, AState, ACustomState, NewArgs, NewArgsWithState,  \ 
     16            Reduce, ReduceWithState, MyInt, MyList, MyDict, FixedOffset, execute 
    1717 
    1818    class MyLoader(yaml.Loader): 
     
    100100                return False 
    101101 
    102     class AnObject(object): 
     102    class AnObject: 
    103103        def __new__(cls, foo=None, bar=None, baz=None): 
    104104            self = object.__new__(cls) 
     
    143143        def __setstate__(self, state): 
    144144            self.foo, self.bar, self.baz = state 
    145  
    146     class InitArgs(AnInstance): 
    147         def __getinitargs__(self): 
    148             return (self.foo, self.bar, self.baz) 
    149         def __getstate__(self): 
    150             return {} 
    151  
    152     class InitArgsWithState(AnInstance): 
    153         def __getinitargs__(self): 
    154             return (self.foo, self.bar) 
    155         def __getstate__(self): 
    156             return self.baz 
    157         def __setstate__(self, state): 
    158             self.baz = state 
    159145 
    160146    class NewArgs(AnObject): 
Note: See TracChangeset for help on using the changeset viewer.