[PATCH 1 of 3] Provide a version independent way to use the set datatype

Eric Hopper hopper at omnifarious.org
Tue Jun 19 10:40:44 CDT 2007


# HG changeset patch
# User Eric Hopper <hopper at omnifarious.org>
# Date 1182267461 25200
# Node ID 5504bb9e36600c6d967a0eb2bd63ba213e75e5e4
# Parent  8d46056960ab555053fd1f2e6536711277609941
Provide a version independent way to use the set datatype.

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -15,6 +15,12 @@ from i18n import _
 from i18n import _
 import cStringIO, errno, getpass, popen2, re, shutil, sys, tempfile
 import os, threading, time, calendar, ConfigParser, locale, glob
+
+try:
+    set = set
+    frozenset = frozenset
+except NameError:
+    from sets import Set as set, ImmutableSet as frozenset
 
 try:
     _encoding = os.environ.get("HGENCODING")

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20070619/3a502966/attachment.pgp 


More information about the Mercurial-devel mailing list