summaryrefslogtreecommitdiffstats
path: root/powerline/lib/path.py
blob: 49ff433c663d73a9ed1b99e37c3e1c0637d8ccd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)

import os


def realpath(path):
	return os.path.abspath(os.path.realpath(path))


def join(*components):
	if any((isinstance(p, bytes) for p in components)):
		return os.path.join(*[
			p if isinstance(p, bytes) else p.encode('ascii')
			for p in components
		])
	else:
		return os.path.join(*components)