Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import os
- def get_workdir(default=None):
- # HOME must always be last but you must not rely on it as existing.
- for v in ['WORKSPACE', 'TRAVIS_BUILD_DIR', 'HOME']:
- if v in os.environ:
- return os.environ[v]
- if not default:
- return os.path.expanduser("~")
- else:
- return default
- x = get_workdir()
- print(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement