Skip to content
Browse files

Bug 656508 - Remove multiple imports of jsobject. r=hskupin

  • Loading branch information...
1 parent 9964801 commit 43e2496aac4db174d4559acfcc6600157ce5ca10 @whimboo whimboo committed Jan 15, 2013
Showing with 2 additions and 4 deletions.
  1. +2 −4 jsbridge/jsbridge/network.py
View
6 jsbridge/jsbridge/network.py
@@ -17,6 +17,8 @@
import simplejson
from simplejson.encoder import encode_basestring_ascii, encode_basestring
+import jsobjects
+
class JavaScriptException(Exception):
pass
@@ -68,17 +70,13 @@ def handle_read(self):
class JSObjectEncoder(simplejson.JSONEncoder):
"""Encoder that supports jsobject references by name."""
def encode(self, o):
- import jsobjects
-
if isinstance(o, jsobjects.JSObject):
return o._name_
else:
return simplejson.JSONEncoder.encode(self, o)
def _iterencode(self, o, markers=None):
# XXX verbosely copied from simplejson
- import jsobjects
-
if isinstance(o, jsobjects.JSObject):
yield o._name_
elif isinstance(o, basestring):

0 comments on commit 43e2496

Please sign in to comment.
Something went wrong with that request. Please try again.