Check for globals in socket
bzr revid: fp@tinyerp.com-20080818223140-l69ekd9uyfw2c87w
This commit is contained in:
parent
bd7c09b70b
commit
7f9e392861
|
@ -28,6 +28,7 @@
|
|||
###############################################################################
|
||||
import socket
|
||||
import cPickle
|
||||
import cStringIO
|
||||
import marshal
|
||||
|
||||
class Myexception(Exception):
|
||||
|
@ -82,7 +83,11 @@ class mysocket:
|
|||
if chunk == '':
|
||||
raise RuntimeError, "socket connection broken"
|
||||
msg = msg + chunk
|
||||
res = cPickle.loads(msg)
|
||||
msgio = cStringIO.StringIO(msg)
|
||||
unpickler = cPickle.Unpickler(msgio)
|
||||
unpickler.find_global = None
|
||||
res = unpickler.load()
|
||||
|
||||
if isinstance(res[0],Exception):
|
||||
if exception:
|
||||
raise Myexception(str(res[0]), str(res[1]))
|
||||
|
|
Loading…
Reference in New Issue