Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 13, 2025
1 parent 637a4f3 commit f9695cb
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/fsspec_xrootd/xrootd.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,7 @@ async def _rm_file(self, path: str, **kwargs: Any) -> None:
async def _touch(self, path: str, truncate: bool = False, **kwargs: Any) -> None:
if truncate or not await self._exists(path):
f = client.File()
status, _ = await _async_wrap(f.open)(
path, OpenFlags.DELETE
)
status, _ = await _async_wrap(f.open)(path, OpenFlags.DELETE)
await _async_wrap(f.close)()
if not status.ok:
raise OSError(f"File not touched properly: {status.message}")
Expand Down Expand Up @@ -999,12 +997,7 @@ def write(self, data: bytes) -> int:
raise ValueError("I/O operation on closed file.")
if self.forced:
raise ValueError("This file has been force-flushed, can only close")
status, _n = self._myFile.write(
data,
self.loc,
len(data),
timeout=self.timeout
)
status, _n = self._myFile.write(data, self.loc, len(data), timeout=self.timeout)
self.loc += len(data)
self.size = max(self.size, self.loc)
if not status.ok:
Expand Down Expand Up @@ -1034,4 +1027,4 @@ def read(self, length: int = -1) -> bytes:
out = cast(bytes, self.cache._fetch(self.loc, self.loc + length))

self.loc += len(out)
return out
return out

0 comments on commit f9695cb

Please sign in to comment.