mirror of
https://github.com/python/cpython.git
synced 2025-08-29 21:25:01 +00:00
New way of generating .pyc files, thanks to Sjoerd.
urllib.py: '+' is not always safe (even though the RFC says so :-( ) whrandom.py: throw away top bits of time to avoid overflow on Mac (where times can be negative)
This commit is contained in:
parent
7b1e974b4b
commit
3bb5448767
5 changed files with 96 additions and 2 deletions
|
@ -39,7 +39,7 @@ class whrandom:
|
|||
if x is None:
|
||||
# Initialize from current time
|
||||
import time
|
||||
t = int(time.time())
|
||||
t = int(time.time() % 0x80000000)
|
||||
t, x = divmod(t, 256)
|
||||
t, y = divmod(t, 256)
|
||||
t, z = divmod(t, 256)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue