diff options
| author | PJ Eby <distutils-sig@python.org> | 2007-02-23 19:28:25 +0000 |
|---|---|---|
| committer | PJ Eby <distutils-sig@python.org> | 2007-02-23 19:28:25 +0000 |
| commit | aba13220b952cd60df2a8f7cf44394d28a5f1814 (patch) | |
| tree | 62f9cec890c14a240cdf722a081fce80e17b84b1 /pkg_resources.py | |
| parent | ae8b6ede870d8d62c3d08b9697a92f75e6f99d9c (diff) | |
| download | python-setuptools-git-aba13220b952cd60df2a8f7cf44394d28a5f1814.tar.gz | |
Get rid of 'sets' module usage under Python 2.4+, so that no warnings
are issued by Python 2.6. (backport from trunk)
--HG--
branch : setuptools-0.6
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4053871
Diffstat (limited to 'pkg_resources.py')
| -rw-r--r-- | pkg_resources.py | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index 4cf81d7b..bfe92e3a 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -14,10 +14,31 @@ method. """ import sys, os, zipimport, time, re, imp, new -from sets import ImmutableSet + +try: + frozenset +except NameError: + from sets import ImmutableSet as frozenset + from os import utime, rename, unlink # capture these to bypass sandboxing from os import open as os_open + + + + + + + + + + + + + + + + def get_supported_platform(): """Return this platform's maximum compatible version. @@ -39,6 +60,26 @@ def get_supported_platform(): pass # not Mac OS X return plat + + + + + + + + + + + + + + + + + + + + __all__ = [ # Basic resource access and distribution/entry point discovery 'require', 'run_script', 'get_provider', 'get_distribution', @@ -2387,7 +2428,7 @@ class Requirement: self.index, self.extras = index, tuple(map(safe_extra,extras)) self.hashCmp = ( self.key, tuple([(op,parsed) for parsed,trans,op,ver in index]), - ImmutableSet(self.extras) + frozenset(self.extras) ) self.__hash = hash(self.hashCmp) |
