Skip to content

Commit 5b40ab1

Browse files
committed
Do not import from unpackaged paths in typing
The tests path is not part of the shipped project, thus this type cannot be checked by users of this project. The correct type in place of the type imported from tests appears to be Optional[ Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass] ]
1 parent babcbcd commit 5b40ab1

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

github/Requester.pyi

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ from typing import Any, Callable, Dict, Iterator, Optional, Tuple, Union
55
from requests.models import Response
66

77
from github.GithubObject import GithubObject
8-
from tests.Framework import ReplayingHttpsConnection
98

109
# from urllib3.util.retry import Retry
1110

@@ -57,7 +56,9 @@ class Requester:
5756
def __authenticate(
5857
self, url: str, responseHeader: Dict[str, Any], parameters: Dict[str, Any],
5958
) -> None: ...
60-
def __customConnection(self, url: str,) -> Optional[ReplayingHttpsConnection]: ...
59+
def __customConnection(
60+
self, url: str,
61+
) -> Optional[Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]]: ...
6162
def __createConnection(
6263
self,
6364
) -> Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]: ...
@@ -120,7 +121,9 @@ class Requester:
120121
parameters: Dict[str, str] = ...,
121122
headers: Dict[str, str] = ...,
122123
input: Optional[str] = ...,
123-
cnx: Optional[ReplayingHttpsConnection] = ...,
124+
cnx: Optional[
125+
Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]
126+
] = ...,
124127
) -> Tuple[int, Dict[str, Any], str]: ...
125128
def requestBlobAndCheck(
126129
self,
@@ -137,7 +140,9 @@ class Requester:
137140
parameters: Optional[Dict[str, Any]] = ...,
138141
headers: Optional[Dict[str, Any]] = ...,
139142
input: Optional[Any] = ...,
140-
cnx: Optional[ReplayingHttpsConnection] = ...,
143+
cnx: Optional[
144+
Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]
145+
] = ...,
141146
) -> Tuple[int, Dict[str, Any], str]: ...
142147
def requestJsonAndCheck(
143148
self,
@@ -154,7 +159,9 @@ class Requester:
154159
parameters: Optional[Dict[str, Any]] = ...,
155160
headers: Optional[Dict[str, Any]] = ...,
156161
input: Optional[OrderedDict] = ...,
157-
cnx: Optional[ReplayingHttpsConnection] = ...,
162+
cnx: Optional[
163+
Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]
164+
] = ...,
158165
) -> Tuple[int, Dict[str, Any], str]: ...
159166
def requestMultipartAndCheck(
160167
self,

0 commit comments

Comments
 (0)