1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-09-15 20:36:55 +00:00

Use sys.platform instead of os.name

mypy only recognizes sys.platform
This commit is contained in:
Unrud 2022-02-01 17:53:46 +01:00
parent 523960bc9f
commit 0221fc357b
7 changed files with 21 additions and 33 deletions

View file

@ -17,6 +17,7 @@
# along with Radicale. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
from tempfile import TemporaryDirectory
from typing import IO, AnyStr, ClassVar, Iterator, Optional, Type
@ -93,7 +94,7 @@ class StorageBase(storage.BaseStorage):
"""
if not self._filesystem_fsync:
return
if os.name == "posix":
if sys.platform != "win32":
try:
fd = os.open(path, 0)
try: