1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
From a03a75a68f62e2f4c99d870b16a3b8b5497ccc45 Mon Sep 17 00:00:00 2001
From: Ryan Dale <ryan.dale@nih.gov>
Date: Tue, 5 Nov 2024 18:43:19 -0500
Subject: [PATCH] better detection of Path for Python 3.13 (address #413)
---
pybedtools/bedtool.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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
|