diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-05-20 17:41:33 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-05-20 17:41:33 -0700 |
commit | 3beb2d432d4fe288b3b1fafefcb702bd524ed4cd (patch) | |
tree | 02c7ff946bb29f1a498fcd31fe67b87bf10c0238 | |
parent | 445181a538b65ac3d3a1d5560448b166ff9495ea (diff) | |
download | portage-3beb2d432d4fe288b3b1fafefcb702bd524ed4cd.tar.gz portage-3beb2d432d4fe288b3b1fafefcb702bd524ed4cd.tar.bz2 portage-3beb2d432d4fe288b3b1fafefcb702bd524ed4cd.zip |
Use os.environ.get() instead of os.getenv(), to hopefully avoid issues
with python-3.2 reported by Arfrever.
-rw-r--r-- | pym/portage/output.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pym/portage/output.py b/pym/portage/output.py index 0dc218ed1..abe10f5f7 100644 --- a/pym/portage/output.py +++ b/pym/portage/output.py @@ -268,7 +268,7 @@ default_xterm_title = None def xtermTitleReset(): global default_xterm_title if default_xterm_title is None: - prompt_command = os.getenv('PROMPT_COMMAND') + prompt_command = os.environ.get('PROMPT_COMMAND', '') if prompt_command == "": default_xterm_title = "" elif prompt_command is not None: @@ -288,12 +288,13 @@ def xtermTitleReset(): os.system(prompt_command) return else: - pwd = os.getenv('PWD','') - home = os.getenv('HOME', '') + pwd = os.environ.get('PWD','') + home = os.environ.get('HOME', '') if home != '' and pwd.startswith(home): pwd = '~' + pwd[len(home):] default_xterm_title = '\x1b]0;%s@%s:%s\x07' % ( - os.getenv('LOGNAME', ''), os.getenv('HOSTNAME', '').split('.', 1)[0], pwd) + os.environ.get('LOGNAME', ''), + os.environ.get('HOSTNAME', '').split('.', 1)[0], pwd) xtermTitle(default_xterm_title, raw=True) def notitles(): |