File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 11
11
if MYPY_CHECK_RUNNING :
12
12
from typing import Optional , List , Dict
13
13
from pip ._vendor .pkg_resources import Distribution
14
+ from pip ._vendor .six .moves import configparser
14
15
from pip ._internal .req .req_install import InstallRequirement
15
16
from pip ._vendor .six import PY3
16
17
if PY3 :
@@ -312,7 +313,7 @@ class ConfigurationFileCouldNotBeLoaded(ConfigurationError):
312
313
"""
313
314
314
315
def __init__ (self , reason = "could not be loaded" , fname = None , error = None ):
315
- # type: (str, Optional[str], Optional[Exception ]) -> None
316
+ # type: (str, Optional[str], Optional[configparser.Error ]) -> None
316
317
super (ConfigurationFileCouldNotBeLoaded , self ).__init__ (error )
317
318
self .reason = reason
318
319
self .fname = fname
@@ -324,6 +325,7 @@ def __str__(self):
324
325
message_part = " in {}." .format (self .fname )
325
326
else :
326
327
assert self .error is not None
327
- # message attribute for Exception is only available for Python 2
328
+ # configparser.Error is missing "message" attribute in typeshed
329
+ # for python 3 (https://github.com/python/typeshed/issues/4058)
328
330
message_part = ".\n {}\n " .format (self .error .message ) # type: ignore
329
331
return "Configuration file {}{}" .format (self .reason , message_part )
You can’t perform that action at this time.
0 commit comments