|
|
|
|
|
|
| Author |
Message |
Qopit *nix forums beginner
Joined: 27 Sep 2005
Posts: 31
|
Posted: Mon Jun 19, 2006 9:35 pm Post subject:
Recommended way to fix core python distribution issues in your own apps?
|
|
|
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 |
|
 |
|
|
The time now is Fri Jan 09, 2009 9:23 pm | All times are GMT
|
|
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
|
|