Permalink
Browse files

few changes towards py3k compat

  • Loading branch information...
1 parent 46f5ec4 commit 96cc727bd90ca9c81897694bcd8bc7d0a756c0fd @technige technige committed Mar 4, 2012
Showing with 8 additions and 0 deletions.
  1. +5 −0 src/py2neo/geoff.py
  2. +3 −0 src/py2neo/rest.py
View
@@ -35,6 +35,11 @@
import sys
import string
+try:
+ from cStringIO import StringIO
+except ImportError:
+ from StringIO import StringIO
+
class Subgraph(object):
View
@@ -102,6 +102,9 @@ def _request(self, method, uri, data=None):
self.__response, self.__content = self._http.request(
uri, method, data, headers
)
+ # for py3k compatibility...
+ if not isinstance(self.__content, str):
+ self.__content = self.__content.decode()
except:
raise IOError("Cannot send {0} request".format(method))
if self.__response.status == 200:

0 comments on commit 96cc727

Please sign in to comment.