From 484fbd72ef2c4f9b6709ecb96da51e175bea2867 Mon Sep 17 00:00:00 2001 From: Victor Nova Date: Thu, 5 Aug 2021 11:51:04 -0700 Subject: [PATCH] validate, that custom Python base types can be inherited from --- src/runtime/typemanager.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/runtime/typemanager.cs b/src/runtime/typemanager.cs index 8d5600e4f..47f73e1aa 100644 --- a/src/runtime/typemanager.cs +++ b/src/runtime/typemanager.cs @@ -390,6 +390,12 @@ static PyTuple GetBaseTypeTuple(Type clrType) { throw new InvalidOperationException("At least one base type must be specified"); } + var nonBases = bases.Where(@base => !@base.Flags.HasFlag(TypeFlags.BaseType)).ToList(); + if (nonBases.Count > 0) + { + throw new InvalidProgramException("The specified Python type(s) can not be inherited from: " + + string.Join(", ", nonBases)); + } return new PyTuple(bases); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy