Small refactoring

Use os.path.abspath for creating absolute path
from given command. This assures that it works
the same on all OSes.
pull/1095/head
pithikos 2015-05-07 15:36:48 +01:00
parent 62a10cee03
commit 6c3cb2c4e1
1 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ def find_cmd_abspath(cmd):
None is returned if no absolute path was found.
"""
if exists(cmd):
return '%s/%s' % (os.getcwd(), cmd)
return os.path.abspath(cmd)
if not 'PATH' in os.environ:
raise Exception("Can't find command path for current platform ('%s')" % sys.platform)
PATH=os.environ['PATH']
@ -109,7 +109,7 @@ def get_caller_name(steps=2):
def error(msg):
print msg
print("ERROR: %s" % msg)
sys.exit(1)