subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1300140 - /subversion/trunk/subversion/tests/cmdline/svntest/wc.py
Date Tue, 13 Mar 2012 14:13:47 GMT
Author: hwright
Date: Tue Mar 13 14:13:47 2012
New Revision: 1300140

URL: http://svn.apache.org/viewvc?rev=1300140&view=rev
Log:
For convenience and backward compat, import the StringIO class from the
appropriate module.

* subversion/tests/cmdline/svntest/wc.py
  (display_nodes): Update callers (yet again).

Modified:
    subversion/trunk/subversion/tests/cmdline/svntest/wc.py

Modified: subversion/trunk/subversion/tests/cmdline/svntest/wc.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/wc.py?rev=1300140&r1=1300139&r2=1300140&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/wc.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/wc.py Tue Mar 13 14:13:47 2012
@@ -29,7 +29,13 @@ import re
 import urllib
 import logging
 import pprint
-import cStringIO as StringIO
+
+if sys.version_info[0] >= 3:
+  # Python >=3.0
+  from io import StringIO
+else:
+  # Python <3.0
+  from cStringIO import StringIO
 
 import svntest
 
@@ -899,7 +905,7 @@ def display_nodes(label, path, expected,
   expected = item_to_node(path, expected)
   actual = item_to_node(path, actual)
 
-  o = StringIO.StringIO()
+  o = StringIO()
   o.write("=============================================================\n")
   o.write("Expected '%s' and actual '%s' in %s tree are different!\n"
                 % (expected.name, actual.name, label))
@@ -919,7 +925,7 @@ def display_nodes(label, path, expected,
 def default_singleton_handler(description, path, item):
   node = item_to_node(path, item)
   logger.warn("Couldn't find node '%s' in %s tree" % (node.name, description))
-  o = StringIO.StringIO()
+  o = StringIO()
   node.pprint(o)
   logger.warn(o.getvalue())
   o.close()



Mime
View raw message