Skip to content

Commit

Permalink
More py3 fixes, bring back py2 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
lopuhin committed Jun 3, 2016
1 parent 683ccc1 commit 7bd8eeb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arachnado/rpc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def handle_request(self, body):
else:
self.send_data(response.data)

def on_done(self, future, *, data):
def on_done(self, future, data):
data['result'] = future.result()
self.send_data(data)

Expand Down
7 changes: 4 additions & 3 deletions arachnado/storages/mongotail.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pymongo
import six
from bson.objectid import ObjectId
from tornado.gen import sleep, coroutine

Expand Down Expand Up @@ -28,7 +28,7 @@ def tail(self, query=None, fields=None, last_object_id=None):
if self.tailing:
raise RuntimeError('This storage is already tailing')
self.tailing = True
if isinstance(last_object_id, basestring):
if isinstance(last_object_id, six.string_types):
last_object_id = ObjectId(last_object_id)

if query is not None:
Expand Down Expand Up @@ -76,7 +76,8 @@ def _objectify(self, query):
stack.append(v)
elif isinstance(v, list):
stack.extend(v)
elif isinstance(v, unicode) and v.startswith(u'ObjectId('):
elif isinstance(v, six.string_types) \
and v.startswith(u'ObjectId('):
d[k] = ObjectId(v[9:-1])

return query
Expand Down

0 comments on commit 7bd8eeb

Please sign in to comment.