Patchwork [1,of,4,evolve-ext] py3: tolerate io/StringIO divergence

login
register
mail settings
Submitter timeless
Date April 20, 2016, 7:19 p.m.
Message ID <ea58367ce4bbae9c1ae5.1461179959@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/14742/
State Accepted
Delegated to: Pierre-Yves David
Headers show

Comments

timeless - April 20, 2016, 7:19 p.m.
# HG changeset patch
# User timeless@gmail.com
# Date 1461178732 0
#      Wed Apr 20 18:58:52 2016 +0000
# Node ID ea58367ce4bbae9c1ae55cdbfc51bcb1f5bb2471
# Parent  8e879d59b20e60e8af013a776f5e3dcc20588fcf
# Available At https://bitbucket.org/timeless/mutable-history/
#              hg pull https://bitbucket.org/timeless/mutable-history/ -r ea58367ce4bb
py3: tolerate io/StringIO divergence

Patch

diff -r 8e879d59b20e -r ea58367ce4bb hgext/evolve.py
--- a/hgext/evolve.py	Tue Apr 19 14:29:40 2016 -0700
+++ 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