Skip to content

Commit

Permalink
replaced PosixPath and WindowsPath with pathlib.Path
Browse files Browse the repository at this point in the history
following suggestion by @djhoese
  • Loading branch information
martin-rdz authored and djhoese committed Jan 4, 2024
1 parent 130361b commit d3fe3fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions satpy/readers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

import logging
import os
import pathlib
import pickle # nosec B403
import warnings
import pathlib
from datetime import datetime, timedelta
from functools import total_ordering

Expand Down Expand Up @@ -780,7 +780,7 @@ def _get_compression(file):

def open_file_or_filename(unknown_file_thing):
"""Try to open the *unknown_file_thing*, otherwise return the filename."""
if isinstance(unknown_file_thing, (pathlib.WindowsPath, pathlib.PosixPath)):
if isinstance(unknown_file_thing, pathlib.Path):
f_obj = unknown_file_thing
else:
try:
Expand Down
2 changes: 1 addition & 1 deletion satpy/readers/hdf5_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
import numpy as np
import xarray as xr

from satpy.readers import open_file_or_filename
from satpy.readers.file_handlers import BaseFileHandler
from satpy.readers.utils import np2str
from satpy.utils import get_legacy_chunk_size
from satpy.readers import open_file_or_filename

LOG = logging.getLogger(__name__)
CHUNK_SIZE = get_legacy_chunk_size()
Expand Down

0 comments on commit d3fe3fe

Please sign in to comment.