[PATCH] obsolete: os.SEEK_END first appeared in Python 2.5

Adrian Buehlmann adrian at cadifra.com
Mon Jul 16 18:00:12 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1342479322 -7200
# Node ID f5e4f9afaccd53520c3c53e48a2667ee119e3d7a
# Parent  67b8cca2f12b0e07d8258d357510805c698e2124
obsolete: os.SEEK_END first appeared in Python 2.5

fixes 48c232873a54 failing for Python 2.4

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -51,7 +51,7 @@
   additional encoding. Keys cannot contain '\0' or ':' and values
   cannot contain '\0'.
 """
-import os, struct
+import struct
 from mercurial import util, base85
 from i18n import _
 
@@ -200,7 +200,7 @@
                 # defined. So we must seek to the end before calling tell(),
                 # or we may get a zero offset for non-zero sized files on
                 # some platforms (issue3543).
-                f.seek(0, os.SEEK_END)
+                f.seek(0, 2) # os.SEEK_END
                 offset = f.tell()
                 transaction.add('obsstore', offset)
                 if offset == 0:


More information about the Mercurial-devel mailing list