Index: /pyyaml/trunk/lib3/yaml/emitter.py
===================================================================
--- /pyyaml/trunk/lib3/yaml/emitter.py	(revision 328)
+++ /pyyaml/trunk/lib3/yaml/emitter.py	(revision 329)
@@ -181,6 +181,5 @@
             self.tag_prefixes = self.DEFAULT_TAG_PREFIXES.copy()
             if self.event.tags:
-                handles = self.event.tags.keys()
-                handles.sort()
+                handles = sorted(self.event.tags.keys())
                 for handle in handles:
                     prefix = self.event.tags[handle]
Index: /pyyaml/trunk/lib3/yaml/constructor.py
===================================================================
--- /pyyaml/trunk/lib3/yaml/constructor.py	(revision 328)
+++ /pyyaml/trunk/lib3/yaml/constructor.py	(revision 329)
@@ -510,5 +510,5 @@
             module_name, object_name = name.rsplit('.', 1)
         else:
-            module_name = '__builtin__'
+            module_name = 'builtins'
             object_name = name
         try:
Index: /pyyaml/trunk/tests3/test_recursive.py
===================================================================
--- /pyyaml/trunk/tests3/test_recursive.py	(revision 328)
+++ /pyyaml/trunk/tests3/test_recursive.py	(revision 329)
@@ -24,6 +24,7 @@
 
 def test_recursive(recursive_filename, verbose=False):
-    exec(open(recursive_filename, 'rb').read())
-    value1 = value
+    context = globals().copy()
+    exec(open(recursive_filename, 'rb').read(), context)
+    value1 = context['value']
     output1 = None
     value2 = None
Index: /pyyaml/trunk/tests3/data/recursive-set.recursive
===================================================================
--- /pyyaml/trunk/tests3/data/recursive-set.recursive	(revision 228)
+++ /pyyaml/trunk/tests3/data/recursive-set.recursive	(revision 329)
@@ -1,6 +1,2 @@
-try:
-    set
-except NameError:
-    from sets import Set as set
 value = set()
 value.add(AnInstance(foo=value, bar=value))
Index: /pyyaml/trunk/tests3/data/construct-python-name-module.data
===================================================================
--- /pyyaml/trunk/tests3/data/construct-python-name-module.data	(revision 146)
+++ /pyyaml/trunk/tests3/data/construct-python-name-module.data	(revision 329)
@@ -1,3 +1,3 @@
-- !!python/name:file
+- !!python/name:str
 - !!python/name:yaml.Loader
 - !!python/name:yaml.dump
Index: /pyyaml/trunk/tests3/data/construct-str-utf8.code
===================================================================
--- /pyyaml/trunk/tests3/data/construct-str-utf8.code	(revision 144)
+++ /pyyaml/trunk/tests3/data/construct-str-utf8.code	(revision 329)
@@ -1,1 +1,1 @@
-u'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430'
+'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430'
Index: /pyyaml/trunk/tests3/data/construct-python-long-short.code
===================================================================
--- /pyyaml/trunk/tests3/data/construct-python-long-short.code	(revision 144)
+++ /pyyaml/trunk/tests3/data/construct-python-long-short.code	(revision 329)
@@ -1,1 +1,1 @@
-123L
+123
Index: /pyyaml/trunk/tests3/data/construct-python-bytes.data
===================================================================
--- /pyyaml/trunk/tests3/data/construct-python-bytes.data	(revision 329)
+++ /pyyaml/trunk/tests3/data/construct-python-bytes.data	(revision 329)
@@ -0,0 +1,1 @@
+--- !!python/bytes 'c29tZSBiaW5hcnkgZGF0YQ=='
Index: /pyyaml/trunk/tests3/data/construct-python-name-module.code
===================================================================
--- /pyyaml/trunk/tests3/data/construct-python-name-module.code	(revision 322)
+++ /pyyaml/trunk/tests3/data/construct-python-name-module.code	(revision 329)
@@ -1,1 +1,1 @@
-[file, yaml.Loader, yaml.dump, abs, yaml.tokens]
+[str, yaml.Loader, yaml.dump, abs, yaml.tokens]
Index: /pyyaml/trunk/tests3/data/construct-python-unicode-ascii.code
===================================================================
--- /pyyaml/trunk/tests3/data/construct-python-unicode-ascii.code	(revision 144)
+++ /pyyaml/trunk/tests3/data/construct-python-unicode-ascii.code	(revision 329)
@@ -1,1 +1,1 @@
-u"ascii string"
+"ascii string"
Index: /pyyaml/trunk/tests3/data/construct-python-bytes.code
===================================================================
--- /pyyaml/trunk/tests3/data/construct-python-bytes.code	(revision 329)
+++ /pyyaml/trunk/tests3/data/construct-python-bytes.code	(revision 329)
@@ -0,0 +1,1 @@
+b'some binary data'
Index: /pyyaml/trunk/tests3/data/construct-python-object.data
===================================================================
--- /pyyaml/trunk/tests3/data/construct-python-object.data	(revision 147)
+++ /pyyaml/trunk/tests3/data/construct-python-object.data	(revision 329)
@@ -7,7 +7,4 @@
 - !!python/object:test_constructor.AState { _foo: 1, _bar: two, _baz: [3,3,3] }
 - !!python/object/new:test_constructor.ACustomState { state: !!python/tuple [1, two, [3,3,3]] }
-
-- !!python/object/new:test_constructor.InitArgs [1, two, [3,3,3]]
-- !!python/object/new:test_constructor.InitArgsWithState { args: [1, two], state: [3,3,3] }
 
 - !!python/object/new:test_constructor.NewArgs [1, two, [3,3,3]]
Index: /pyyaml/trunk/tests3/data/construct-python-unicode-utf8.code
===================================================================
--- /pyyaml/trunk/tests3/data/construct-python-unicode-utf8.code	(revision 144)
+++ /pyyaml/trunk/tests3/data/construct-python-unicode-utf8.code	(revision 329)
@@ -1,1 +1,1 @@
-u'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430'
+'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430'
Index: /pyyaml/trunk/tests3/data/construct-python-object.code
===================================================================
--- /pyyaml/trunk/tests3/data/construct-python-object.code	(revision 147)
+++ /pyyaml/trunk/tests3/data/construct-python-object.code	(revision 329)
@@ -8,7 +8,4 @@
 AState(1, 'two', [3,3,3]),
 ACustomState(1, 'two', [3,3,3]),
-
-InitArgs(1, 'two', [3,3,3]),
-InitArgsWithState(1, 'two', [3,3,3]),
 
 NewArgs(1, 'two', [3,3,3]),
Index: /pyyaml/trunk/tests3/data/construct-python-str-utf8.code
===================================================================
--- /pyyaml/trunk/tests3/data/construct-python-str-utf8.code	(revision 144)
+++ /pyyaml/trunk/tests3/data/construct-python-str-utf8.code	(revision 329)
@@ -1,1 +1,1 @@
-u'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430'.encode('utf-8')
+'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430'
Index: /pyyaml/trunk/tests3/test_constructor.py
===================================================================
--- /pyyaml/trunk/tests3/test_constructor.py	(revision 328)
+++ /pyyaml/trunk/tests3/test_constructor.py	(revision 329)
@@ -7,4 +7,5 @@
 
 def execute(code):
+    global value
     exec(code)
     return value
@@ -12,7 +13,6 @@
 def _make_objects():
     global MyLoader, MyDumper, MyTestClass1, MyTestClass2, MyTestClass3, YAMLObject1, YAMLObject2,  \
-            AnObject, AnInstance, AState, ACustomState, InitArgs, InitArgsWithState,    \
-            NewArgs, NewArgsWithState, Reduce, ReduceWithState, MyInt, MyList, MyDict,  \
-            FixedOffset, execute
+            AnObject, AnInstance, AState, ACustomState, NewArgs, NewArgsWithState,  \
+            Reduce, ReduceWithState, MyInt, MyList, MyDict, FixedOffset, execute
 
     class MyLoader(yaml.Loader):
@@ -100,5 +100,5 @@
                 return False
 
-    class AnObject(object):
+    class AnObject:
         def __new__(cls, foo=None, bar=None, baz=None):
             self = object.__new__(cls)
@@ -143,18 +143,4 @@
         def __setstate__(self, state):
             self.foo, self.bar, self.baz = state
-
-    class InitArgs(AnInstance):
-        def __getinitargs__(self):
-            return (self.foo, self.bar, self.baz)
-        def __getstate__(self):
-            return {}
-
-    class InitArgsWithState(AnInstance):
-        def __getinitargs__(self):
-            return (self.foo, self.bar)
-        def __getstate__(self):
-            return self.baz
-        def __setstate__(self, state):
-            self.baz = state
 
     class NewArgs(AnObject):
