Johan Euphrosine <[EMAIL PROTECTED]> writes:
> Johan Euphrosine <[EMAIL PROTECTED]> writes:
>
> > Loic Dachary <[EMAIL PROTECTED]> writes:
> >
> > > proppy <[EMAIL PROTECTED]> writes:
> > >
> > > > Did someone on the list experienced the same issues ?
> > >
> > > Nope. That calls for a fixture, I think.
> >
> > >>> import simplejson
> > >>> print simplejson.JSONEncoder.__doc__
> >
> > Advices the following:
> > To extend this to recognize other objects, subclass and implement a
> > ``.default()`` method with another method that returns a serializable
> > object for ``o`` if possible, otherwise it should call the superclass
> > implementation (to raise ``TypeError``).
> >
> > Subclassing JSONEncoder into packets.py, and implementing default() to
> > return o.__dict__, should do the trick.
>
> Please review the following patch, it corrects the problem for me:
> http://jpoker.aminche.com/poker-table-is-not-json-serializable.patch
It seems that this patch break the following testcase, so I guess this
is the desired behaviour:
FAIL: test_infoPackFail (__main__.PokerClientPacketsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./test-pokerclientpackets.py", line 146, in test_infoPackFail
self.failUnlessRaises(TypeError, type)
AssertionError: TypeError not raised
--
bou ^
_______________________________________________
Pokersource-users mailing list
[email protected]
https://mail.gna.org/listinfo/pokersource-users