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