diff --git a/pybedtools/bedtool.py b/pybedtools/bedtool.py index 1b8b491d..a0e3d421 100644 --- a/pybedtools/bedtool.py +++ b/pybedtools/bedtool.py @@ -13,6 +13,7 @@ import gzip import pysam from warnings import warn +import pathlib from pathlib import Path from .helpers import ( @@ -495,7 +496,7 @@ def __init__(self, fn=None, from_string=False, remote=False): else: # if fn is a Path object, we have to use its string representation - if "pathlib.PurePath" in str(type(fn).__mro__): + if isinstance(fn, pathlib.PurePath): fn = str(fn) # our work is already done