@@ -48,8 +48,7 @@ class PackageNotFoundError(ModuleNotFoundError):
48
48
"""The package was not found."""
49
49
50
50
def __str__ (self ):
51
- tmpl = "No package metadata was found for {self.name}"
52
- return tmpl .format (** locals ())
51
+ return f"No package metadata was found for { self .name } "
53
52
54
53
@property
55
54
def name (self ):
@@ -386,7 +385,7 @@ def __init__(self, spec):
386
385
self .mode , _ , self .value = spec .partition ('=' )
387
386
388
387
def __repr__ (self ):
389
- return '<FileHash mode: {} value: {}>' . format ( self .mode , self . value )
388
+ return f '<FileHash mode: { self . mode } value: { self .value } >'
390
389
391
390
392
391
class Distribution :
@@ -570,13 +569,13 @@ def _convert_egg_info_reqs_to_simple_reqs(sections):
570
569
"""
571
570
572
571
def make_condition (name ):
573
- return name and 'extra == "{name}"' . format ( name = name )
572
+ return name and f 'extra == "{ name } "'
574
573
575
574
def parse_condition (section ):
576
575
section = section or ''
577
576
extra , sep , markers = section .partition (':' )
578
577
if extra and markers :
579
- markers = '({markers})' . format ( markers = markers )
578
+ markers = f '({ markers } )'
580
579
conditions = list (filter (None , [markers , make_condition (extra )]))
581
580
return '; ' + ' and ' .join (conditions ) if conditions else ''
582
581
0 commit comments