Fixed intermittent test failure in saranwrap, changed imports to comply with pyrage requirements.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from cPickle import dumps, loads
|
import cPickle as Pickle
|
||||||
import os
|
import os
|
||||||
import struct
|
import struct
|
||||||
import sys
|
import sys
|
||||||
@@ -106,8 +106,8 @@ def _read_response(id, attribute, input, cp):
|
|||||||
try:
|
try:
|
||||||
str = _read_lp_hunk(input)
|
str = _read_lp_hunk(input)
|
||||||
_prnt(`str`)
|
_prnt(`str`)
|
||||||
response = loads(str)
|
response = Pickle.loads(str)
|
||||||
except (AttributeError, DeadProcess), e:
|
except (AttributeError, DeadProcess, Pickle.UnpicklingError), e:
|
||||||
raise UnrecoverableError(e)
|
raise UnrecoverableError(e)
|
||||||
_prnt("response: %s" % response)
|
_prnt("response: %s" % response)
|
||||||
if response[0] == 'value':
|
if response[0] == 'value':
|
||||||
@@ -130,7 +130,7 @@ def _write_lp_hunk(stream, hunk):
|
|||||||
|
|
||||||
def _write_request(param, output):
|
def _write_request(param, output):
|
||||||
_prnt("request: %s" % param)
|
_prnt("request: %s" % param)
|
||||||
str = dumps(param)
|
str = Pickle.dumps(param)
|
||||||
_write_lp_hunk(output, str)
|
_write_lp_hunk(output, str)
|
||||||
|
|
||||||
def _is_local(attribute):
|
def _is_local(attribute):
|
||||||
@@ -495,7 +495,7 @@ class Server(object):
|
|||||||
_log("Exiting normally")
|
_log("Exiting normally")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
request = loads(str_)
|
request = Pickle.loads(str_)
|
||||||
_log("request: %s (%s)" % (request, self._objects))
|
_log("request: %s (%s)" % (request, self._objects))
|
||||||
req = request
|
req = request
|
||||||
id = None
|
id = None
|
||||||
@@ -558,7 +558,7 @@ class Server(object):
|
|||||||
def respond(self, body):
|
def respond(self, body):
|
||||||
_log("responding with: %s" % body)
|
_log("responding with: %s" % body)
|
||||||
#_log("objects: %s" % self._objects)
|
#_log("objects: %s" % self._objects)
|
||||||
s = dumps(body)
|
s = Pickle.dumps(body)
|
||||||
_log(`s`)
|
_log(`s`)
|
||||||
str_ = _write_lp_hunk(self._out, s)
|
str_ = _write_lp_hunk(self._out, s)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user