@@ -155,7 +155,7 @@ def __init__(self, name, importspec, implprefix=None, attr=None):
155
155
setattr (self , name , val )
156
156
for name , importspec in importspec .items ():
157
157
if isinstance (importspec , dict ):
158
- subname = "{ }.{}" . format ( self . __name__ , name )
158
+ subname = f" { self . __name__ } .{ name } "
159
159
apimod = ApiModule (subname , importspec , implprefix )
160
160
sys .modules [subname ] = apimod
161
161
setattr (self , name , apimod )
@@ -167,7 +167,7 @@ def __init__(self, name, importspec, implprefix=None, attr=None):
167
167
modpath = implprefix + modpath
168
168
169
169
if not attrname :
170
- subname = "{ }.{}" . format ( self . __name__ , name )
170
+ subname = f" { self . __name__ } .{ name } "
171
171
apimod = AliasModule (subname , modpath )
172
172
sys .modules [subname ] = apimod
173
173
if "." not in name :
@@ -183,7 +183,7 @@ def __repr__(self):
183
183
repr_list .append ("from " + repr (self .__file__ ))
184
184
if repr_list :
185
185
return "<ApiModule {!r} {}>" .format (self .__name__ , " " .join (repr_list ))
186
- return "<ApiModule {!r}>" . format ( self . __name__ )
186
+ return f "<ApiModule { self . __name__ !r} >"
187
187
188
188
@_synchronized
189
189
def __makeattr (self , name , isgetattr = False ):
@@ -210,7 +210,7 @@ def __makeattr(self, name, isgetattr=False):
210
210
# * Only call __getattribute__ if there is a possibility something has set
211
211
# the attribute we're looking for since __getattr__ was called
212
212
if threading is not None and isgetattr :
213
- return super (ApiModule , self ).__getattribute__ (name )
213
+ return super ().__getattribute__ (name )
214
214
raise AttributeError (name )
215
215
else :
216
216
result = importobj (modpath , attrname )
@@ -252,7 +252,7 @@ def getmod():
252
252
return mod [0 ]
253
253
254
254
x = modpath + ("." + attrname if attrname else "" )
255
- repr_result = "<AliasModule {!r} for {!r}>" . format ( modname , x )
255
+ repr_result = f "<AliasModule { modname !r} for { x !r} >"
256
256
257
257
class AliasModule (ModuleType ):
258
258
def __repr__ (self ):
0 commit comments