py3: tolerate io/StringIO divergence
authortimeless@gmail.com
Wed, 20 Apr 2016 18:58:52 +0000
changeset 1678 1247d87a738d
parent 1677 48c3a472aec7
child 1679 6103f6ac8110
py3: tolerate io/StringIO divergence
hgext/evolve.py
--- a/hgext/evolve.py	Sun Apr 24 22:31:58 2016 -0400
+++ b/hgext/evolve.py	Wed Apr 20 18:58:52 2016 +0000
@@ -61,7 +61,12 @@
 
 import sys, os
 import random
-from StringIO import StringIO
+try:
+    import StringIO as io
+    StringIO = io.StringIO
+except ImportError:
+    import io
+    StringIO = io.StringIO
 import re
 import collections
 import socket