Return an absolute path.
(path)
| 395 | |
| 396 | |
| 397 | def abspath(path): |
| 398 | """Return an absolute path.""" |
| 399 | path = os.fspath(path) |
| 400 | if not isabs(path): |
| 401 | if isinstance(path, bytes): |
| 402 | cwd = os.getcwdb() |
| 403 | else: |
| 404 | cwd = os.getcwd() |
| 405 | path = join(cwd, path) |
| 406 | return normpath(path) |
| 407 | |
| 408 | |
| 409 | # Return a canonical path (i.e. the absolute location of a file on the |