# HG changeset patch # User Alexis S. L. Carvalho # Date 2006-12-02 18:08:00 # Node ID b9d3e12da485aac9a8b16386991ede5037841935 # Parent 9433bdcaa9ae30fed3cee257cdca1661067fba5c changegroup.py: delay the loading of the bz2 and zlib modules diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -50,8 +50,8 @@ class nocompress(object): bundletypes = { "": ("", nocompress), "HG10UN": ("HG10UN", nocompress), - "HG10BZ": ("HG10", bz2.BZ2Compressor), - "HG10GZ": ("HG10GZ", zlib.compressobj), + "HG10BZ": ("HG10", lambda: bz2.BZ2Compressor()), + "HG10GZ": ("HG10GZ", lambda: zlib.compressobj()), } def writebundle(cg, filename, bundletype):