Skip to content

Instantly share code, notes, and snippets.

@mmysinger
mmysinger / fspath_str.py
Created April 14, 2016 06:29
Interoperability of fspath str only version
# This is posixpath from Python 3.4 based (not ideal, but it is what I had handy)
from os.path import _get_sep
# str-only.
def fspath(path):
try:
path = path.__fspath__()
except AttributeError: