diff options
-rwxr-xr-x | bin/repoman | 3 | ||||
-rw-r--r-- | pym/_emerge/BlockerCache.py | 4 | ||||
-rw-r--r-- | pym/_emerge/JobStatusDisplay.py | 3 | ||||
-rw-r--r-- | pym/_emerge/Package.py | 4 | ||||
-rw-r--r-- | pym/_emerge/Scheduler.py | 3 | ||||
-rw-r--r-- | pym/_emerge/depgraph.py | 3 | ||||
-rw-r--r-- | pym/_emerge/format_size.py | 5 | ||||
-rw-r--r-- | pym/portage/__init__.py | 3 | ||||
-rw-r--r-- | pym/portage/cache/metadata.py | 4 | ||||
-rw-r--r-- | pym/portage/cache/sqlite.py | 4 | ||||
-rw-r--r-- | pym/portage/cache/template.py | 3 | ||||
-rw-r--r-- | pym/portage/dbapi/bintree.py | 4 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 3 | ||||
-rw-r--r-- | pym/portage/dep.py | 3 | ||||
-rw-r--r-- | pym/portage/elog/mod_echo.py | 4 | ||||
-rw-r--r-- | pym/portage/exception.py | 4 | ||||
-rw-r--r-- | pym/portage/locks.py | 4 | ||||
-rw-r--r-- | pym/portage/mail.py | 3 | ||||
-rw-r--r-- | pym/portage/process.py | 3 | ||||
-rw-r--r-- | pym/portage/proxy/lazyimport.py | 3 | ||||
-rw-r--r-- | pym/portage/sets/base.py | 4 |
21 files changed, 74 insertions, 0 deletions
diff --git a/bin/repoman b/bin/repoman index 330250258..823cdce62 100755 --- a/bin/repoman +++ b/bin/repoman @@ -72,6 +72,9 @@ from portage.output import bold, create_color_func, darkgreen, \ from portage.output import ConsoleStyleFile, StyleWriter from portage.util import cmp_sort_key, writemsg_level +if sys.hexversion >= 0x3000000: + basestring = str + util.initialize_logger() # 14 is the length of DESCRIPTION="" diff --git a/pym/_emerge/BlockerCache.py b/pym/_emerge/BlockerCache.py index 9962ffdd5..c4270242f 100644 --- a/pym/_emerge/BlockerCache.py +++ b/pym/_emerge/BlockerCache.py @@ -2,6 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ +import sys from portage.util import writemsg from portage.data import secpass import portage @@ -12,6 +13,9 @@ try: except ImportError: import pickle +if sys.hexversion >= 0x3000000: + basestring = str + class BlockerCache(portage.cache.mappings.MutableMapping): """This caches blockers of installed packages so that dep_check does not have to be done for every single installed package on every invocation of diff --git a/pym/_emerge/JobStatusDisplay.py b/pym/_emerge/JobStatusDisplay.py index f543d00bb..fbda727ee 100644 --- a/pym/_emerge/JobStatusDisplay.py +++ b/pym/_emerge/JobStatusDisplay.py @@ -21,6 +21,9 @@ from portage.output import xtermTitle from _emerge.getloadavg import getloadavg +if sys.hexversion >= 0x3000000: + basestring = str + class JobStatusDisplay(object): _bound_properties = ("curval", "failed", "running") diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index a38edbd0d..0ea119ef8 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -3,12 +3,16 @@ # $Id$ import re +import sys from itertools import chain import portage from portage.dep import paren_reduce, use_reduce, \ paren_normalize, paren_enclose from _emerge.Task import Task +if sys.hexversion >= 0x3000000: + basestring = str + class Package(Task): __hash__ = Task.__hash__ diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index aa0a08475..83ffd4b9f 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -45,6 +45,9 @@ from _emerge.RootConfig import RootConfig from _emerge.SlotObject import SlotObject from _emerge.SequentialTaskQueue import SequentialTaskQueue +if sys.hexversion >= 0x3000000: + basestring = str + class Scheduler(PollScheduler): _opts_ignore_blockers = \ diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 0585b9c28..af609a0e4 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -51,6 +51,9 @@ from _emerge.show_invalid_depstring_notice import show_invalid_depstring_notice from _emerge.UnmergeDepPriority import UnmergeDepPriority from _emerge.visible import visible +if sys.hexversion >= 0x3000000: + basestring = str + class _frozen_depgraph_config(object): def __init__(self, settings, trees, myopts, spinner): diff --git a/pym/_emerge/format_size.py b/pym/_emerge/format_size.py index f48d11b17..ff1aeb23f 100644 --- a/pym/_emerge/format_size.py +++ b/pym/_emerge/format_size.py @@ -2,6 +2,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ +import sys + +if sys.hexversion >= 0x3000000: + basestring = str + # formats a size given in bytes nicely def format_size(mysize): if isinstance(mysize, basestring): diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index f85ae0c61..6fce50b2c 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -123,6 +123,9 @@ except ImportError as e: sys.stderr.write(" "+str(e)+"\n\n") raise +if sys.hexversion >= 0x3000000: + basestring = str + # Assume utf_8 fs encoding everywhere except in merge code, where the # user's locale is respected. _encodings = { diff --git a/pym/portage/cache/metadata.py b/pym/portage/cache/metadata.py index 8b35593c2..2b8047d43 100644 --- a/pym/portage/cache/metadata.py +++ b/pym/portage/cache/metadata.py @@ -5,6 +5,7 @@ import errno import re +import sys from portage import os from portage import _encodings from portage import _unicode_encode @@ -13,6 +14,9 @@ import portage.eclass_cache from portage.cache.template import reconstruct_eclasses from portage.cache.mappings import ProtectedDict +if sys.hexversion >= 0x3000000: + basestring = str + # this is the old cache format, flat_list. count maintained here. magic_line_count = 22 diff --git a/pym/portage/cache/sqlite.py b/pym/portage/cache/sqlite.py index 073ca2cd8..2bb740722 100644 --- a/pym/portage/cache/sqlite.py +++ b/pym/portage/cache/sqlite.py @@ -2,6 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ +import sys from portage.cache import fs_template from portage.cache import cache_errors from portage import os @@ -15,6 +16,9 @@ except ImportError: from pysqlite2 import dbapi2 as db_module DBError = db_module.Error +if sys.hexversion >= 0x3000000: + basestring = str + class database(fs_template.FsBased): autocommits = False diff --git a/pym/portage/cache/template.py b/pym/portage/cache/template.py index d4573c760..7fc4e9495 100644 --- a/pym/portage/cache/template.py +++ b/pym/portage/cache/template.py @@ -9,6 +9,9 @@ from portage.cache.mappings import ProtectedDict import sys import warnings +if sys.hexversion >= 0x3000000: + basestring = str + class database(object): # this is for metadata/cache transfer. # basically flags the cache needs be updated when transfered cache to cache. diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 1eb9d7d8a..3728e3e9f 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -29,8 +29,12 @@ import codecs import errno import re import stat +import sys from itertools import chain +if sys.hexversion >= 0x3000000: + basestring = str + class bindbapi(fakedbapi): _known_keys = frozenset(list(fakedbapi._known_keys) + \ ["CHOST", "repository", "USE"]) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index ff26476ac..dcec611f0 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -57,6 +57,9 @@ try: except ImportError: import pickle +if sys.hexversion >= 0x3000000: + basestring = str + class PreservedLibsRegistry(object): """ This class handles the tracking of preserved library objects """ def __init__(self, root, filename, autocommit=True): diff --git a/pym/portage/dep.py b/pym/portage/dep.py index ebdf1ea83..4a2514474 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -27,6 +27,9 @@ from portage.versions import catpkgsplit, catsplit, \ pkgcmp, pkgsplit, ververify, _version import portage.cache.mappings +if sys.hexversion >= 0x3000000: + basestring = str + def cpvequal(cpv1, cpv2): """ diff --git a/pym/portage/elog/mod_echo.py b/pym/portage/elog/mod_echo.py index 28d77649e..1df2fca3b 100644 --- a/pym/portage/elog/mod_echo.py +++ b/pym/portage/elog/mod_echo.py @@ -5,10 +5,14 @@ from __future__ import print_function +import sys from portage.output import EOutput, colorize from portage.const import EBUILD_PHASES from portage.localization import _ +if sys.hexversion >= 0x3000000: + basestring = str + _items = [] def process(mysettings, key, logentries, fulltext): global _items diff --git a/pym/portage/exception.py b/pym/portage/exception.py index f47937115..85efc2767 100644 --- a/pym/portage/exception.py +++ b/pym/portage/exception.py @@ -2,8 +2,12 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ +import sys from portage.localization import _ +if sys.hexversion >= 0x3000000: + basestring = str + class PortageException(Exception): """General superclass for portage exceptions""" def __init__(self,value): diff --git a/pym/portage/locks.py b/pym/portage/locks.py index 896f948f1..cdbbf03c3 100644 --- a/pym/portage/locks.py +++ b/pym/portage/locks.py @@ -9,6 +9,7 @@ __all__ = ["lockdir", "unlockdir", "lockfile", "unlockfile", \ import errno import stat +import sys import time from portage import os from portage.exception import DirectoryNotFound, FileNotFound, \ @@ -18,6 +19,9 @@ from portage.output import EOutput from portage.util import writemsg from portage.localization import _ +if sys.hexversion >= 0x3000000: + basestring = str + HARDLINK_FD = -2 # Used by emerge in order to disable the "waiting for lock" message diff --git a/pym/portage/mail.py b/pym/portage/mail.py index c2c7354d4..85192d097 100644 --- a/pym/portage/mail.py +++ b/pym/portage/mail.py @@ -18,6 +18,9 @@ from portage import _unicode_encode from portage.localization import _ import portage +if sys.hexversion >= 0x3000000: + basestring = str + def create_message(sender, recipient, subject, body, attachments=None): if sys.hexversion < 0x3000000: diff --git a/pym/portage/process.py b/pym/portage/process.py index 2329e6a1b..d24b6f28a 100644 --- a/pym/portage/process.py +++ b/pym/portage/process.py @@ -26,6 +26,9 @@ try: except ImportError: max_fd_limit = 256 +if sys.hexversion >= 0x3000000: + basestring = str + if os.path.isdir("/proc/%i/fd" % os.getpid()): def get_open_fds(): return (int(fd) for fd in os.listdir("/proc/%i/fd" % os.getpid()) \ diff --git a/pym/portage/proxy/lazyimport.py b/pym/portage/proxy/lazyimport.py index 1a4a246ef..77e80e02e 100644 --- a/pym/portage/proxy/lazyimport.py +++ b/pym/portage/proxy/lazyimport.py @@ -14,6 +14,9 @@ except ImportError: from portage.proxy.objectproxy import ObjectProxy +if sys.hexversion >= 0x3000000: + basestring = str + _module_proxies = {} _module_proxies_lock = threading.RLock() diff --git a/pym/portage/sets/base.py b/pym/portage/sets/base.py index adf05fbf8..4b39e9df9 100644 --- a/pym/portage/sets/base.py +++ b/pym/portage/sets/base.py @@ -2,11 +2,15 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ +import sys from portage import cpv_getkey, flatten from portage.dep import Atom, isvalidatom, match_from_list, \ best_match_to_list, dep_getkey, use_reduce, paren_reduce from portage.exception import InvalidAtom +if sys.hexversion >= 0x3000000: + basestring = str + OPERATIONS = ["merge", "unmerge"] class PackageSet(object): |