Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit38e0b5d

Browse files
committed
validate, that custom Python base types can be inherited from
1 parentd821b35 commit38e0b5d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/runtime/typemanager.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,12 @@ static PyTuple GetBaseTypeTuple(Type clrType)
390390
{
391391
thrownewInvalidOperationException("At least one base type must be specified");
392392
}
393+
varnonBases=bases.Where(@base=>!@base.Flags.HasFlag(TypeFlags.BaseType)).ToList();
394+
if(nonBases.Count>0)
395+
{
396+
thrownewInvalidProgramException("The specified Python type(s) can not be inherited from: "
397+
+string.Join(", ",nonBases));
398+
}
393399

394400
returnnewPyTuple(bases);
395401
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp