File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,7 @@ class PackageNotFoundError(ModuleNotFoundError):
52
52
"""The package was not found."""
53
53
54
54
def __str__ (self ):
55
- tmpl = "No package metadata was found for {self.name}"
56
- return tmpl .format (** locals ())
55
+ return f"No package metadata was found for { self .name } "
57
56
58
57
@property
59
58
def name (self ):
@@ -391,7 +390,7 @@ def __init__(self, spec):
391
390
self .mode , _ , self .value = spec .partition ('=' )
392
391
393
392
def __repr__ (self ):
394
- return '<FileHash mode: {} value: {}>' . format ( self .mode , self . value )
393
+ return f '<FileHash mode: { self . mode } value: { self .value } >'
395
394
396
395
397
396
class Distribution :
@@ -575,13 +574,13 @@ def _convert_egg_info_reqs_to_simple_reqs(sections):
575
574
"""
576
575
577
576
def make_condition (name ):
578
- return name and 'extra == "{name}"' . format ( name = name )
577
+ return name and f 'extra == "{ name } "'
579
578
580
579
def parse_condition (section ):
581
580
section = section or ''
582
581
extra , sep , markers = section .partition (':' )
583
582
if extra and markers :
584
- markers = '({markers})' . format ( markers = markers )
583
+ markers = f '({ markers } )'
585
584
conditions = list (filter (None , [markers , make_condition (extra )]))
586
585
return '; ' + ' and ' .join (conditions ) if conditions else ''
587
586
Original file line number Diff line number Diff line change @@ -76,10 +76,10 @@ class PyPy_repr:
76
76
def __compat_repr__ (self ): # pragma: nocover
77
77
def make_param (name ):
78
78
value = getattr (self , name )
79
- return '{name}={value!r}' . format ( ** locals ())
79
+ return f '{ name } ={ value !r} '
80
80
81
81
params = ', ' .join (map (make_param , self ._fields ))
82
- return 'EntryPoint({params})' . format ( ** locals ())
82
+ return f 'EntryPoint({ params } )'
83
83
84
84
if affected : # pragma: nocover
85
85
__repr__ = __compat_repr__
You can’t perform that action at this time.
0 commit comments