Index: pyyaml/trunk/lib3/yaml/__init__.py
===================================================================
--- pyyaml/trunk/lib/yaml/__init__.py	(revision 314)
+++ pyyaml/trunk/lib3/yaml/__init__.py	(revision 328)
@@ -1,19 +1,16 @@
 
-from error import *
-
-from tokens import *
-from events import *
-from nodes import *
-
-from loader import *
-from dumper import *
-
-__version__ = '3.07'
-
-try:
-    from cyaml import *
-    __with_libyaml__ = True
-except ImportError:
-    __with_libyaml__ = False
+__version__ = '3.08'
+__with_libyaml__ = False
+
+from .error import *
+
+from .tokens import *
+from .events import *
+from .nodes import *
+
+from .loader import *
+from .dumper import *
+
+import io
 
 def scan(stream, Loader=Loader):
@@ -92,9 +89,5 @@
     getvalue = None
     if stream is None:
-        try:
-            from cStringIO import StringIO
-        except ImportError:
-            from StringIO import StringIO
-        stream = StringIO()
+        stream = io.StringIO()
         getvalue = stream.getvalue
     dumper = Dumper(stream, canonical=canonical, indent=indent, width=width,
@@ -116,9 +109,5 @@
     getvalue = None
     if stream is None:
-        try:
-            from cStringIO import StringIO
-        except ImportError:
-            from StringIO import StringIO
-        stream = StringIO()
+        stream = io.StringIO()
         getvalue = stream.getvalue
     dumper = Dumper(stream, canonical=canonical, indent=indent, width=width,
@@ -152,9 +141,5 @@
     getvalue = None
     if stream is None:
-        try:
-            from cStringIO import StringIO
-        except ImportError:
-            from StringIO import StringIO
-        stream = StringIO()
+        stream = io.StringIO()
         getvalue = stream.getvalue
     dumper = Dumper(stream, default_style=default_style,
@@ -260,5 +245,5 @@
             cls.yaml_dumper.add_representer(cls, cls.to_yaml)
 
-class YAMLObject(object):
+class YAMLObject(metaclass=YAMLObjectMetaclass):
     """
     An object that can dump itself to a YAML stream
@@ -266,5 +251,4 @@
     """
 
-    __metaclass__ = YAMLObjectMetaclass
     __slots__ = ()  # no direct instantiation, so allow immutable subclasses
 
@@ -275,4 +259,5 @@
     yaml_flow_style = None
 
+    @classmethod
     def from_yaml(cls, loader, node):
         """
@@ -280,6 +265,6 @@
         """
         return loader.construct_yaml_object(node, cls)
-    from_yaml = classmethod(from_yaml)
-
+
+    @classmethod
     def to_yaml(cls, dumper, data):
         """
@@ -288,4 +273,3 @@
         return dumper.represent_yaml_object(cls.yaml_tag, data, cls,
                 flow_style=cls.yaml_flow_style)
-    to_yaml = classmethod(to_yaml)
-
+
