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 12, 2025
1 parent fc93c50 commit 49cb5e9
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 @@ -997,12 +995,7 @@ def write(self, data):
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 @@ -1031,4 +1024,4 @@ def read(self, length=-1):
out = self.cache._fetch(self.loc, self.loc + length)

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

0 comments on commit 49cb5e9

Please sign in to comment.