diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -299,7 +299,7 @@ def _fm1purereadmarkers(data, off): # Loop on markers stop = len(data) - _fm1fsize - ufixed = util.unpacker(_fm1fixed) + ufixed = struct.Struct(_fm1fixed).unpack while off <= stop: # read fixed part diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -19,7 +19,7 @@ import error, osutil, encoding, parsers import errno, shutil, sys, tempfile, traceback import re as remod import os, time, datetime, calendar, textwrap, signal, collections -import imp, socket, urllib, struct +import imp, socket, urllib import gc if os.name == 'nt': @@ -232,10 +232,6 @@ except NameError: import subprocess closefds = os.name == 'posix' -def unpacker(fmt): - """create a struct unpacker for the specified format""" - return struct.Struct(fmt).unpack - def popen2(cmd, env=None, newlines=False): # Setting bufsize to -1 lets the system decide the buffer size. # The default for bufsize is 0, meaning unbuffered. This leads to