portage.debug.trace_handler.__init__(): Fix compatibility with Python 3.
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Wed, 11 Jan 2012 03:57:23 +0000 (04:57 +0100)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Wed, 11 Jan 2012 03:57:23 +0000 (04:57 +0100)
pym/portage/debug.py

index ce642fef65a9d1975d5df2566cc956e3654d1971..ebf1a138a1b0459ce2733f93e63344cac8ebaf3e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import os
@@ -26,7 +26,7 @@ class trace_handler(object):
        def __init__(self):
                python_system_paths = []
                for x in sys.path:
-                       if os.path.basename(x).startswith("python2."):
+                       if os.path.basename(x) == "python%s.%s" % sys.version_info[:2]:
                                python_system_paths.append(x)
 
                self.ignore_prefixes = []