Beispiel #1
0
 def test_callapi(self):
     f = io.BytesIO()
     # With and without keyword arguments
     pickle.dump(123, f, -1)
     pickle.dump(123, file=f, protocol=-1)
     pickle.dumps(123, -1)
     pickle.dumps(123, protocol=-1)
     pickle.Pickler(f, -1)
     pickle.Pickler(f, protocol=-1)
Beispiel #2
0
 def dumps(obj, protocol=2):
     return b64encode(serializer.dumps(obj, protocol))
Beispiel #3
0
 def dumps(obj):
     return serializer.dumps(obj, protocol=2)
Beispiel #4
0
def dumps(obj, protocol=2):
    l = serializer.dumps(obj, protocol)
    return l
Beispiel #5
0
 def dumps(self, arg, proto=3, fast=0):
     if proto != 3:
         return pickle.dumps(arg, protocol=proto)
     else:
         return self._dumps(arg)