Skip to content

Commit

Permalink
fix more type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades committed Jun 3, 2021
1 parent 3407d0e commit d22069f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion poetry/repositories/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def find_links_for_package(self, package: "Package") -> List["Link"]:
return []

def search(self, query: str) -> List["Package"]:
results = []
results: List["Package"] = []

for package in self.packages:
if query in package.name:
Expand Down
2 changes: 1 addition & 1 deletion poetry/utils/password_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def __init__(self, config: "Config") -> None:
self._keyring = None

@property
def keyring(self) -> KeyRing:
def keyring(self) -> Optional[KeyRing]:
if self._keyring is None:
self._keyring = KeyRing("poetry-repository")
if not self._keyring.is_available():
Expand Down
4 changes: 3 additions & 1 deletion poetry/utils/setup_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def _find_single_string(
value = self._find_in_dict(variable, name)

if value is None:
return
return None

if isinstance(value, ast.Str):
return value.s
Expand All @@ -325,6 +325,7 @@ def _find_in_call(self, call: ast.Call, name: str) -> Optional[Any]:
for keyword in call.keywords:
if keyword.arg == name:
return keyword.value
return None

def _find_call_kwargs(self, call: ast.Call) -> Optional[Any]:
kwargs = None
Expand Down Expand Up @@ -356,3 +357,4 @@ def _find_in_dict(
for key, val in zip(dict_.keys, dict_.values):
if isinstance(key, ast.Str) and key.s == name:
return val
return None
2 changes: 1 addition & 1 deletion poetry/utils/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import signal
import sys

from pathlib import Optional
from pathlib import Path
from typing import Any
from typing import Optional

import pexpect

Expand Down

0 comments on commit d22069f

Please sign in to comment.