Skip to content

Commit 593f6d0

Browse files
committed
trying to get mypy to run on Windows
1 parent 3873dfd commit 593f6d0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

fileformats/generic/fsobject.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import platform
23
import typing as ty
34
from pathlib import Path
45
from fileformats.core.fileset import FileSet
@@ -59,10 +60,9 @@ def exists(self) -> bool:
5960
return True
6061

6162
def group(self) -> ty.Optional[str]:
62-
try:
63-
return self.fspath.group()
64-
except AttributeError:
63+
if platform.system() == "Windows":
6564
return None
65+
return self.fspath.group()
6666

6767
def is_dir(self) -> bool:
6868
return self.fspath.is_dir()
@@ -75,10 +75,9 @@ def name(self) -> str:
7575
return self.fspath.name
7676

7777
def owner(self) -> ty.Optional[str]:
78-
try:
79-
return self.fspath.owner()
80-
except AttributeError:
78+
if platform.system() == "Windows":
8179
return None
80+
return self.fspath.owner()
8281

8382
@property
8483
def parent(self) -> Path:

0 commit comments

Comments
 (0)