Index: pyyaml/trunk/lib/yaml/__init__.py
===================================================================
--- pyyaml/trunk/lib/yaml/__init__.py	(revision 314)
+++ pyyaml/trunk/lib/yaml/__init__.py	(revision 333)
@@ -92,8 +92,5 @@
     getvalue = None
     if stream is None:
-        try:
-            from cStringIO import StringIO
-        except ImportError:
-            from StringIO import StringIO
+        from StringIO import StringIO
         stream = StringIO()
         getvalue = stream.getvalue
@@ -116,8 +113,8 @@
     getvalue = None
     if stream is None:
-        try:
+        if encoding is None:
+            from StringIO import StringIO
+        else:
             from cStringIO import StringIO
-        except ImportError:
-            from StringIO import StringIO
         stream = StringIO()
         getvalue = stream.getvalue
@@ -152,8 +149,8 @@
     getvalue = None
     if stream is None:
-        try:
+        if encoding is None:
+            from StringIO import StringIO
+        else:
             from cStringIO import StringIO
-        except ImportError:
-            from StringIO import StringIO
         stream = StringIO()
         getvalue = stream.getvalue
