Skip to content

Commit 274d72a

Browse files
dnicolodirgommers
authored andcommitted
MAINT: fix typing annotation and remove superfluous checks
1 parent 669a3be commit 274d72a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

mesonpy/__init__.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ class _WheelBuilder():
252252
def __init__(
253253
self,
254254
project: Project,
255-
metadata: Optional[Metadata],
255+
metadata: Metadata,
256256
source_dir: pathlib.Path,
257257
build_dir: pathlib.Path,
258258
sources: Dict[str, Dict[str, Any]],
@@ -349,9 +349,6 @@ def wheel(self) -> bytes:
349349
@property
350350
def entrypoints_txt(self) -> bytes:
351351
"""dist-info entry_points.txt."""
352-
if not self._metadata:
353-
return b''
354-
355352
data = self._metadata.entrypoints.copy()
356353
data.update({
357354
'console_scripts': self._metadata.scripts,
@@ -902,10 +899,9 @@ def metadata(self) -> bytes:
902899

903900
@property
904901
def license_file(self) -> Optional[pathlib.Path]:
905-
if self._metadata:
906-
license_ = self._metadata.license
907-
if license_ and license_.file:
908-
return pathlib.Path(license_.file)
902+
license_ = self._metadata.license
903+
if license_ and license_.file:
904+
return pathlib.Path(license_.file)
909905
return None
910906

911907
@property

0 commit comments

Comments
 (0)