File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -312,14 +312,15 @@ class BuildExtension(build_ext, object):
312
312
@classmethod
313
313
def with_options (cls , ** options ):
314
314
r'''
315
- Returns an alternative constructor that extends any original keyword
315
+ Returns a subclass with alternative constructor that extends any original keyword
316
316
arguments to the original constructor with the given options.
317
317
'''
318
- def init_with_options (* args , ** kwargs ):
319
- kwargs = kwargs .copy ()
320
- kwargs .update (options )
321
- return cls (* args , ** kwargs )
322
- return init_with_options
318
+ class cls_with_options (cls ):
319
+ def __init__ (self , * args , ** kwargs ):
320
+ kwargs .update (options )
321
+ super ().__init__ (* args , ** kwargs )
322
+
323
+ return cls_with_options
323
324
324
325
def __init__ (self , * args , ** kwargs ):
325
326
super (BuildExtension , self ).__init__ (* args , ** kwargs )
You can’t perform that action at this time.
0 commit comments