Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 60225f6

Browse files
committedFeb 13, 2025
Ensure that Python 3.11 and earlier work as expected.
1 parent 1c73878 commit 60225f6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎src/oracledb/impl/base/utils.pyx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,13 @@ cdef int _set_enum_param(dict args, str name, object enum_obj,
101101
if in_val is not None:
102102
if not isinstance(in_val, str) or in_val.isdigit():
103103
out_val[0] = int(in_val)
104-
if out_val[0] in enum_obj:
104+
if isinstance(in_val, enum_obj):
105105
return 0
106+
try:
107+
enum_obj(out_val[0])
108+
return 0
109+
except ValueError:
110+
pass
106111
else:
107112
enum_val = getattr(enum_obj, in_val.upper(), None)
108113
if enum_val is not None:

0 commit comments

Comments
 (0)
Please sign in to comment.