Skip to content

Commit 6c3cb2c

Browse files
committed
Small refactoring
Use os.path.abspath for creating absolute path from given command. This assures that it works the same on all OSes.
1 parent 62a10ce commit 6c3cb2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

workspace_tools/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def find_cmd_abspath(cmd):
6565
None is returned if no absolute path was found.
6666
"""
6767
if exists(cmd):
68-
return '%s/%s' % (os.getcwd(), cmd)
68+
return os.path.abspath(cmd)
6969
if not 'PATH' in os.environ:
7070
raise Exception("Can't find command path for current platform ('%s')" % sys.platform)
7171
PATH=os.environ['PATH']
@@ -109,7 +109,7 @@ def get_caller_name(steps=2):
109109

110110

111111
def error(msg):
112-
print msg
112+
print("ERROR: %s" % msg)
113113
sys.exit(1)
114114

115115

0 commit comments

Comments
 (0)