Skip to content

Commit

Permalink
Fix returns, and grouped exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldcampbelljr committed Feb 13, 2024
1 parent 55d3b88 commit 3d3ef5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bedboss/bedclassifier/bedclassifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(

def get_bed_type(
bed: str, standard_chrom: Optional[str] = None, no_fail: Optional[bool] = True
) -> Union[str, None]:
) -> str:
"""
get the bed file type (ex. bed3, bed3+n )
standardize chromosomes if necessary:
Expand Down Expand Up @@ -127,7 +127,7 @@ def get_bed_type(

try:
df = pd.read_csv(bed, sep="\t", header=None, nrows=4)
except pandas.errors.ParserError as e:
except (pandas.errors.ParserError, pandas.errors.EmptyDataError) as e:
if no_fail:
_LOGGER.warning(
f"Unable to parse bed file {bed}, setting bed_type = Unknown"
Expand Down

0 comments on commit 3d3ef5d

Please sign in to comment.