Skip to content

Commit 82ef916

Browse files
Convert to macro
1 parent 9b43d7f commit 82ef916

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Modules/_decimal/_decimal.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858

5959
#include "clinic/_decimal.c.h"
6060

61+
#define MPD_SPEC_VERSION "1.70"
62+
6163
/*[clinic input]
6264
module _decimal
6365
class _decimal.Decimal "PyObject *" "&dec_spec"
@@ -7580,7 +7582,7 @@ decimal_getattr(PyObject *self, PyObject *args)
75807582
1) < 0) {
75817583
return NULL;
75827584
}
7583-
return PyUnicode_FromString("1.70");
7585+
return PyUnicode_FromString(MPD_SPEC_VERSION);
75847586
}
75857587

75867588
PyErr_Format(PyExc_AttributeError, "module 'decimal' has no attribute %R", name);
@@ -7914,7 +7916,7 @@ _decimal_exec(PyObject *m)
79147916
}
79157917

79167918
/* Add specification version number */
7917-
CHECK_INT(PyModule_AddStringConstant(m, "SPEC_VERSION", "1.70"));
7919+
CHECK_INT(PyModule_AddStringConstant(m, "SPEC_VERSION", MPD_SPEC_VERSION));
79187920
CHECK_INT(PyModule_AddStringConstant(m, "__libmpdec_version__", mpd_version()));
79197921

79207922
return 0;

0 commit comments

Comments
 (0)