Skip to content

Commit

Permalink
Fix enum coercion to int
Browse files Browse the repository at this point in the history
  • Loading branch information
myrsloik authored and WolframRhodium committed Apr 4, 2024
1 parent 0c9b5da commit 6539ded
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cython/vapoursynth.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 6539ded

Please sign in to comment.