Update imports for Python 3

2to3 fixer imports (+ manual changes)
This commit is contained in:
Thomas Kluyver 2013-10-23 17:21:47 -07:00
parent 4a14ed7e22
commit 51040fb768
2 changed files with 6 additions and 3 deletions

View File

@ -16,7 +16,10 @@ Authors:
# Imports
#-----------------------------------------------------------------------------
import Cookie
try:
from http.cookies import SimpleCookie # Py 3
except ImportError:
from Cookie import SimpleCookie # Py 2
import logging
from tornado import web
from tornado import websocket
@ -102,7 +105,7 @@ class AuthenticatedZMQStreamHandler(ZMQStreamHandler, IPythonHandler):
logging.error("First ws message didn't have the form 'identity:[cookie]' - %r", msg)
try:
self.request._cookies = Cookie.SimpleCookie(msg)
self.request._cookies = SimpleCookie(msg)
except:
self.log.warn("couldn't parse cookie string: %s",msg, exc_info=True)

View File

@ -15,7 +15,7 @@ from __future__ import print_function
import sys
from StringIO import StringIO
from io import StringIO
from subprocess import Popen, PIPE
import unittest