From 695dd438f36198c8289a2761c38e415d602bd4e0 Mon Sep 17 00:00:00 2001 From: Varun Madiath Date: Wed, 15 Nov 2023 15:56:30 -0500 Subject: [PATCH] Allow enc_style to have values other than 0 and 1 --- source/encoder.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/encoder.c b/source/encoder.c index 5bb6c8de..df375a78 100644 --- a/source/encoder.c +++ b/source/encoder.c @@ -131,9 +131,9 @@ CBOREncoder_init(CBOREncoderObject *self, PyObject *args, PyObject *kwargs) int value_sharing = 0, timestamp_format = 0, enc_style = 0, date_as_datetime = 0, string_referencing = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|pOpOppp", keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|pOpOBpp", keywords, &fp, ×tamp_format, &tz, &value_sharing, - &default_handler, &enc_style, &date_as_datetime, + &default_handler, &self->enc_style, &date_as_datetime, &string_referencing)) return -1; // Predicate values are returned as ints, but need to be stored as bool or ubyte @@ -141,8 +141,7 @@ CBOREncoder_init(CBOREncoderObject *self, PyObject *args, PyObject *kwargs) self->timestamp_format = true; if (value_sharing == 1) self->value_sharing = true; - if (enc_style == 1) - self->enc_style = 1; + if (string_referencing == 1) { self->string_referencing = true; self->string_namespacing = true;