summaryrefslogtreecommitdiff
path: root/src/py_amount.cc
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2022-07-04 22:30:31 +0200
committerMartin Michlmayr <tbm@cyrius.com>2023-02-01 09:31:05 +0800
commitadf9d22de4d5c422dcaeca022ea53880f7264be6 (patch)
tree48c99bde533a0118e8452bdc804dc8465469d398 /src/py_amount.cc
parentba33c732de8e272576066d7a22de5ebc01a355c9 (diff)
downloadledger-adf9d22de4d5c422dcaeca022ea53880f7264be6.tar.gz
ledger-adf9d22de4d5c422dcaeca022ea53880f7264be6.tar.bz2
ledger-adf9d22de4d5c422dcaeca022ea53880f7264be6.zip
Remove support for Python 2.x
Diffstat (limited to 'src/py_amount.cc')
-rw-r--r--src/py_amount.cc22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/py_amount.cc b/src/py_amount.cc
index 8561c9f5..fad66bde 100644
--- a/src/py_amount.cc
+++ b/src/py_amount.cc
@@ -33,9 +33,6 @@
#include "pyinterp.h"
#include "pyutils.h"
-#if PY_MAJOR_VERSION < 3
-#include "pyfstream.h"
-#endif
#include "commodity.h"
#include "annotate.h"
#include "pool.h"
@@ -64,21 +61,6 @@ namespace {
return amount.value(datetime_t(moment), in_terms_of);
}
-#if PY_MAJOR_VERSION < 3
- void py_parse_2(amount_t& amount, object in, unsigned char flags) {
- if (PyFile_Check(in.ptr())) {
- pyifstream instr(reinterpret_cast<PyFileObject *>(in.ptr()));
- amount.parse(instr, flags);
- } else {
- PyErr_SetString(PyExc_IOError,
- _("Argument to amount.parse(file) is not a file object"));
- }
- }
- void py_parse_1(amount_t& amount, object in) {
- py_parse_2(amount, in, 0);
- }
-#endif
-
void py_parse_str_1(amount_t& amount, const string& str) {
amount.parse(str);
}
@@ -290,10 +272,6 @@ internal precision."))
.def("strip_annotations", py_strip_annotations_0)
.def("strip_annotations", py_strip_annotations_1)
-#if PY_MAJOR_VERSION < 3
- .def("parse", py_parse_1)
- .def("parse", py_parse_2)
-#endif
.def("parse", py_parse_str_1)
.def("parse", py_parse_str_2)