offlineimap rev 518

"Automatic Subversion Change Mailer" <[email protected]> Thu, 24 Jul 2003 16:15:47 -0500 (CDT)
Newsgroups gmane.mail.imap.offlineimap.subversion
Message-ID <[email protected]>
You are receiving this message because
all commits get sent to this address.

Author: jgoerzen
Date: 2003-07-24 16:15:27 -0500 (Thu, 24 Jul 2003)
New Revision: 518

Modified:
  offlineimap/head/offlineimap/init.py

Log:
Fixed a problem with the version number printout routine.


Diff:
Modified: offlineimap/head/offlineimap/init.py
==============================================================================
--- offlineimap/head/offlineimap/init.py	2003-07-24 20:58:20 UTC (rev 517)
+++ offlineimap/head/offlineimap/init.py	2003-07-24 21:15:27 UTC (rev 518)
@@ -20,16 +20,24 @@
 from offlineimap.localeval import LocalEval
 from offlineimap.threadutil import InstanceLimitedThread, ExitNotifyThread
 from offlineimap.ui import UIBase
-import re, os, os.path, offlineimap, sys, fcntl
+import re, os, os.path, offlineimap, sys
 from offlineimap.CustomConfig import CustomConfigParser
 from threading import *
 import threading
 from getopt import getopt
 
+try:
+    import fcntl
+    hasfcntl = 1
+except:
+    hasfcntl = 0
+
 lockfd = None
 
 def lock(config, ui):
-    global lockfd
+    global lockfd, hasfcntl
+    if not hasfcntl:
+        return
     lockfd = open(config.getmetadatadir() + "/lock", "w")
     try:
         fcntl.flock(lockfd, fcntl.LOCK_EX | fcntl.LOCK_NB)
@@ -38,7 +46,7 @@
         ui.terminate(1)
 
 def startup(versionno):
-    assert versionno == version.versionstr, "Revision of main program (%d) does not match that of library (%d).  Please double-check your PYTHONPATH and installation locations." % (revno, version.revno)
+    assert versionno == version.versionstr, "Revision of main program (%s) does not match that of library (%s).  Please double-check your PYTHONPATH and installation locations." % (versionno, version.versionstr)
     options = {}
     if '--help' in sys.argv[1:]:
         sys.stdout.write(version.cmdhelp + "\n")