rostertab, common: Use the default arg of os.getenv().

This commit is contained in:
Emmanuel Gil Peyrot 2018-08-15 14:26:15 +02:00
parent 5ea82ac0af
commit 1b48f9e63d
2 changed files with 2 additions and 2 deletions

View file

@ -47,7 +47,7 @@ def _is_in_path(command: str, return_abs_path=False) -> Union[bool, str]:
and *return_abs_path* is True, otherwise False.
"""
path = os.getenv('PATH') or ''
path = os.getenv('PATH', default='')
for directory in path.split(os.pathsep):
try:
if command in os.listdir(directory):

View file

@ -611,7 +611,7 @@ class RosterInfoTab(Tab):
n = the_input.get_argument_position()
if n == complete_number:
if args[n - 1] == '' or len(args) < n + 1:
home = os.getenv('HOME') or '/'
home = os.getenv('HOME', default='/')
return Completion(
the_input.new_completion, [home, '/tmp'], n, quotify=True)
path_ = Path(args[n])