File tree Expand file tree Collapse file tree
include/irods/private/re/python Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,16 +46,11 @@ if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
4646 message (STATUS "Setting unspecified CMAKE_BUILD_TYPE to '${CMAKE_BUILD_TYPE} '" )
4747endif ()
4848
49- if (NOT IRODS_PYTHON_VERSION)
50- set (IRODS_PYTHON_VERSION "3" CACHE STRING "The version of python to link against" FORCE )
51- message (STATUS "Setting unspecified IRODS_PYTHON_VERSION to '${IRODS_PYTHON_VERSION} '. This is the correct setting for normal builds." )
52- endif ()
53-
5449find_package (OpenSSL REQUIRED COMPONENTS Crypto SSL )
5550find_package (nlohmann_json "3.6.1" REQUIRED )
5651find_package (fmt "8.1.1"
5752 HINTS "${IRODS_EXTERNALS_FULLPATH_FMT} " )
58- find_package (Python " ${IRODS_PYTHON_VERSION} " REQUIRED COMPONENTS Development )
53+ find_package (Python 3 REQUIRED COMPONENTS Development )
5954
6055set (
6156 PLUGIN
Original file line number Diff line number Diff line change 44// include this first to fix macro redef warnings
55#include < pyconfig.h>
66
7- #include < patchlevel .h>
7+ #include < Python .h>
88
9- #if PY_VERSION_HEX < 0x03000000
10- extern " C" void initirods_errors ();
11- #else
12- # include < Python.h>
139extern " C" PyObject* PyInit_irods_errors ();
14- #endif
1510
1611#endif // RE_PYTHON_IRODS_ERRORS_HPP
Original file line number Diff line number Diff line change 3636
3737#include " irods/private/re/python/types/type_sequence.hpp"
3838
39- #if PY_VERSION_HEX < 0x03000000
40- extern " C" void initirods_types ();
41- #else
42- # include < Python.h>
39+ #include < Python.h>
40+
4341extern " C" PyObject* PyInit_irods_types ();
44- #endif
4542
4643void init_irods_types ();
4744
Original file line number Diff line number Diff line change @@ -193,11 +193,7 @@ namespace
193193 bp::handle<> h_encoded (PyUnicode_AsUTF8String (py_obj));
194194 void * storage = reinterpret_cast <boost::python::converter::rvalue_from_python_storage<std::string>*>(data)
195195 ->storage .bytes ;
196- #if PY_VERSION_HEX < 0x03000000
197- new (storage) std::string (PyString_AsString (h_encoded.get ()));
198- #else
199196 new (storage) std::string (PyBytes_AsString (h_encoded.get ()));
200- #endif
201197 data->convertible = storage;
202198 }
203199
@@ -343,15 +339,9 @@ namespace
343339static irods::error start (irods::default_re_ctx&, const std::string& _instance_name)
344340{
345341 try {
346- #if PY_VERSION_HEX < 0x03000000
347- PyImport_AppendInittab (" plugin_wrappers" , &initplugin_wrappers);
348- PyImport_AppendInittab (" irods_types" , &initirods_types);
349- PyImport_AppendInittab (" irods_errors" , &initirods_errors);
350- #else
351342 PyImport_AppendInittab (" plugin_wrappers" , &PyInit_plugin_wrappers);
352343 PyImport_AppendInittab (" irods_types" , &PyInit_irods_types);
353344 PyImport_AppendInittab (" irods_errors" , &PyInit_irods_errors);
354- #endif
355345 Py_InitializeEx (0 );
356346 std::lock_guard<std::recursive_mutex> lock{python_mutex};
357347 boost::filesystem::path etc_irods_path = irods::get_irods_config_directory ();
You can’t perform that action at this time.
0 commit comments