summaryrefslogtreecommitdiff
blob: a91818fca60c847f20e03f40b30d5662b2514b50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 582eeeaa930639ccfe9b789b057f170824edd73a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Wed, 17 May 2017 20:53:29 +0200
Subject: [PATCH] tests: Fix StringIO import for Python 3

Python 3 no longer provides a 'cStringIO' module. Use StringIO from 'io'
module instead.
---
 tests/test_integration.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/test_integration.py b/tests/test_integration.py
index e6f432c..cf02a4f 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -3,7 +3,10 @@ import pstats
 import unittest
 
 from .profile_code import top, expected_output
-from cStringIO import StringIO
+try:
+    from cStringIO import StringIO
+except ImportError:
+    from io import StringIO
 from pyprof2calltree import CalltreeConverter
 
 class MockTimeProfile(cProfile.Profile):
-- 
2.13.0