Make find_binary() use os.environ.get instead of os.getenv, since os.getenv
authorZac Medico <zmedico@gentoo.org>
Mon, 21 Sep 2009 20:29:30 +0000 (20:29 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 21 Sep 2009 20:29:30 +0000 (20:29 -0000)
isn't behaving correctly in py3k (maybe a unicode wrapper issue?).

svn path=/main/trunk/; revision=14364

pym/portage/process.py

index 68c523a09e627404945ee31b6106630e470b8d7e..e7f09cd2d212a5c37b10a17746a0ad1b5b77ec0c 100644 (file)
@@ -386,8 +386,7 @@ def find_binary(binary):
        @rtype: None or string
        @returns: full path to binary or None if the binary could not be located.
        """
-       
-       for path in os.getenv("PATH", "").split(":"):
+       for path in os.environ.get("PATH", "").split(":"):
                filename = "%s/%s" % (path, binary)
                if os.access(filename, os.X_OK) and os.path.isfile(filename):
                        return filename