From 6539ded2465cfeddf492d8c9ce5f6c5f734e4fe0 Mon Sep 17 00:00:00 2001 From: Fredrik Mellbin Date: Wed, 3 Apr 2024 10:00:01 +0200 Subject: [PATCH] Fix enum coercion to int --- src/cython/vapoursynth.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cython/vapoursynth.pyx b/src/cython/vapoursynth.pyx index f0a012ab..8cf9313d 100644 --- a/src/cython/vapoursynth.pyx +++ b/src/cython/vapoursynth.pyx @@ -792,7 +792,7 @@ cdef void dictToMap(dict ndict, VSMap *inm, VSCore *core, const VSAPI *funcs) ex ckey = key.encode('utf-8') val = ndict[key] - if isinstance(val, (str, bytes, bytearray, RawNode, RawFrame)): + if isinstance(val, (str, bytes, bytearray, RawNode, RawFrame, enum.Flag)): val = [val] else: try: @@ -840,7 +840,7 @@ cdef void typedDictToMap(dict ndict, dict atypes, VSMap *inm, VSCore *core, cons if val is None: continue - if isinstance(val, (str, bytes, bytearray, enum.Flag, RawNode, RawFrame)) or not isinstance(val, Iterable): + if isinstance(val, (str, bytes, bytearray, enum.Flag, RawNode, RawFrame, enum.Flag)) or not isinstance(val, Iterable): val = [val] for v in val: @@ -1028,7 +1028,7 @@ cdef class FrameProps(object): cdef bytes b = name.encode('utf-8') cdef const VSAPI *funcs = self.funcs val = value - if isinstance(val, (str, bytes, bytearray, RawNode, RawFrame)): + if isinstance(val, (str, bytes, bytearray, RawNode, RawFrame, enum.Flag)): val = [val] else: try: