From: <fwi...@us...> - 2008-08-06 23:51:05
|
Revision: 5099 http://jython.svn.sourceforge.net/jython/?rev=5099&view=rev Author: fwierzbicki Date: 2008-08-06 23:51:03 +0000 (Wed, 06 Aug 2008) Log Message: ----------- Putting in fake SystemRandom that throws NotImplementedError on all accesses so the rest of test_random.py can run (and fail for better reasons). Modified Paths: -------------- branches/asm/Lib/random.py Modified: branches/asm/Lib/random.py =================================================================== --- branches/asm/Lib/random.py 2008-08-06 19:35:41 UTC (rev 5098) +++ branches/asm/Lib/random.py 2008-08-06 23:51:03 UTC (rev 5099) @@ -765,7 +765,27 @@ y = (y + a) % 256 or 1 z = (z + a) % 256 or 1 self.__whseed(x, y, z) +## --------------- Operating System Random Source ------------------ +class SystemRandom(Random): + """ + XXX: throw NotImplementedError for any attemt to use this for now. + """ + + def random(self): + self._notimplemented() + + def getrandbits(self, k): + self._notimplemented() + + def _stub(self, *args, **kwds): + self._notimplemented() + + def _notimplemented(self, *args, **kwds): + raise NotImplementedError('SystemRandom not implemented on Jython.') + getstate = setstate = _notimplemented + + ## -------------------- test program -------------------- def _test_generator(n, funccall): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |