Skip to content

Commit

Permalink
Updated lockfile to 0.7 and fixed a Python 2.6 issue. See http://code…
Browse files Browse the repository at this point in the history
  • Loading branch information
brosner committed Mar 9, 2009
1 parent 4236144 commit 3f18d36
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion notification/lockfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import sys
import socket
import os
import thread
import threading
import time
import errno
Expand All @@ -63,6 +62,10 @@
threading.current_thread
except AttributeError:
threading.current_thread = threading.currentThread
try:
# python 2.6 has threading.current_thread so we need to do this separately.
threading.Thread.get_name
except AttributeError:
threading.Thread.get_name = threading.Thread.getName

__all__ = ['Error', 'LockError', 'LockTimeout', 'AlreadyLocked',
Expand Down

1 comment on commit 3f18d36

@grahamu
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm puzzled why you removed "import thread". The thread module is accessed in MkdirFileLock():

tname = "%x-" % thread.get_ident()

On my Windows machine the missing "import thread" causes that line to fail with "NameError: global name "thread" is not defined". How can this be working for you?

Please sign in to comment.