niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » python
Recommended way to fix core python distribution issues in your own apps?
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
Qopit
*nix forums beginner


Joined: 27 Sep 2005
Posts: 31

PostPosted: Mon Jun 19, 2006 9:35 pm    Post subject: Recommended way to fix core python distribution issues in your own apps? Reply with quote

I've got a case where I need to tweak the implementation of a default
python library due to what I consider to be an issue in the library.

What is the best way to do this and make an attempt to remain
compatible with future releases?

My specific problem is with the clock used in the threading.Event and
threading.Timer. It currently uses time.time, which is affected by
changes in system time. eg: if you change the system clock somehow at
some time (say, with an NTP broadcast) you may get a surprise in the
timing of your code execution.

What I do right now is basically this:

import sys
import time
import threading
if sys.platform == 'win32':
threading._time = time.clock

in which case I'm simply forcing the internal clock used in the
Event/Timer code to use a time-independent performance timer rather
than the system time.

I figured this is a much better way to do it than snagging a private
copy of threading.py and making a direct change to it, but am curious
if anyone has a better way of doing this type of thing? For example, I
have no way of guaranteeing that this hack will work come a change to
2.5 or later.

Thanks,
Russ
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
The time now is Fri Jan 09, 2009 9:23 pm | All times are GMT
navigation Forum index » Programming » python
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Postfix SMTP client issues damber Postfix 1 Sat Apr 19, 2008 11:33 am
No new posts Dynamic IP Issues, when Sever is on Fixed. spode Postfix 2 Tue Aug 14, 2007 2:10 pm
No new posts postfix dovecot mysql issues gnetcon Postfix 0 Thu Aug 03, 2006 9:19 pm
No new posts Python proficiency test Kent Johnson python 0 Fri Jul 21, 2006 10:47 am
No new posts Since there was talk of if-then-else not being allowed in... Casey Hawthorne python 5 Fri Jul 21, 2006 3:41 am

Loans | Budapest | internet marketing secrets | Mortgages | Free Verizon Ringtones
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1841s ][ Queries: 16 (0.1198s) ][ GZIP on - Debug on ]