Ticket #5486: jython_no_pid.patch
File jython_no_pid.patch, 1.5 KB (added by , 17 years ago) |
---|
-
django/core/mail.py
50 50 """ 51 51 timeval = time.time() 52 52 utcdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(timeval)) 53 pid = os.getpid() 53 try: 54 pid = os.getpid() 55 except AttributeError: 56 # At least on Jython there is no getpid() 57 pid = 1 54 58 randint = random.randrange(100000) 55 59 if idstring is None: 56 60 idstring = '' -
django/contrib/sessions/models.py
15 15 "Returns session key that isn't being used." 16 16 # The random module is seeded when this Apache child is created. 17 17 # Use SECRET_KEY as added salt. 18 try: 19 pid = os.getpid() 20 except AttributeError: 21 # At least on Jython there is no getpid() 22 pid = 1 18 23 while 1: 19 session_key = md5.new("%s%s%s%s" % (random.randint(0, sys.maxint - 1), os.getpid(), time.time(), settings.SECRET_KEY)).hexdigest()24 session_key = md5.new("%s%s%s%s" % (random.randint(0, sys.maxint - 1), pid, time.time(), settings.SECRET_KEY)).hexdigest() 20 25 try: 21 26 self.get(session_key=session_key) 22 27 except self.model.DoesNotExist: