summaryrefslogtreecommitdiff
path: root/paste/exceptions
diff options
context:
space:
mode:
authorCyril Roelandt <cyril.roelandt@enovance.com>2014-03-18 12:49:12 +0100
committerCyril Roelandt <cyril.roelandt@enovance.com>2014-03-18 12:49:12 +0100
commit674ae7718bc06a8b8c8b658075bf82c8198fb632 (patch)
tree0075bace24ead7f03ae7cb18935e4c707f71a860 /paste/exceptions
parent3cdb7e4227cbaad690b1c1557c03fa6da0decc36 (diff)
downloadpaste-674ae7718bc06a8b8c8b658075bf82c8198fb632.tar.gz
Python 3: use new names of standard library modules
Use "try/except ImportError" to try Python 2 and Python 3 names.
Diffstat (limited to 'paste/exceptions')
-rw-r--r--paste/exceptions/collector.py5
-rw-r--r--paste/exceptions/errormiddleware.py5
2 files changed, 2 insertions, 8 deletions
diff --git a/paste/exceptions/collector.py b/paste/exceptions/collector.py
index 65f9ec0..4f6d4c6 100644
--- a/paste/exceptions/collector.py
+++ b/paste/exceptions/collector.py
@@ -23,10 +23,7 @@ supplements
import sys
import traceback
import time
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
+from six.moves import cStringIO as StringIO
import linecache
from paste.exceptions import serial_number_generator
import warnings
diff --git a/paste/exceptions/errormiddleware.py b/paste/exceptions/errormiddleware.py
index 784414f..5654598 100644
--- a/paste/exceptions/errormiddleware.py
+++ b/paste/exceptions/errormiddleware.py
@@ -7,10 +7,7 @@ Error handler middleware
import sys
import traceback
import cgi
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
+from six.moves import cStringIO as StringIO
from paste.exceptions import formatter, collector, reporter
from paste import wsgilib
from paste import request