Skip to content

Commit ddacaef

Browse files
committed
Keywords can be also types derived from str
1 parent 24ee3bd commit ddacaef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/objmodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3351,7 +3351,7 @@ void rearrangeArguments(ParamReceiveSpec paramspec, const ParamNames* param_name
33513351
for (const auto& p : *d_kwargs) {
33523352
auto k = coerceUnicodeToStr(p.first);
33533353

3354-
if (k->cls != str_cls)
3354+
if (!isSubclass(k->cls, str_cls))
33553355
raiseExcHelper(TypeError, "%s() keywords must be strings", func_name);
33563356

33573357
BoxedString* s = static_cast<BoxedString*>(k);

0 commit comments

Comments
 (0)