SHA256
1
0
forked from pool/boost
boost/0001-Fix-exec_file-for-Python-3-3.4.patch
Stephan Kulow 540c5bdf5e Accepting request 306161 from home:dirkmueller:branches:devel:libraries:c_c++
- update to 1.58.0:
  boost docs remain at 1.56 since upstream hasn't updated yet
  * New Libraries: Endian, Sort.
  * Updated Libraries: Asio, Chrono, Container, Context, Conversion,
  DateTime, Flyweight, Function, Functional/Factory, Fusion, Geometry,
  Hash, Interprocess, Intrusive, Lexical Cast, Log, Math, Move,
  Multi-index Containers, Multiprecision, Optional, Phoenix,
  Predef, Random, Thread, TypeErasure, TypeIndex, Units,
  Unordered, Variant.
  See http://www.boost.org/users/history/version_1_58_0.html
- add 0001-Fix-exec_file-for-Python-3-3.4.patch ,
  0002-Fix-a-regression-with-non-constexpr-types.patch: Fixes regressions
  in 1.58
- drop bjam-alignment.patch, boost-gcc5.patch: Already fixed upstream
  differently
- add boost-rpmoptflags-only.patch: Build only with optflags
- add boost-aarch64-flags.patch: Avoid using -m64
- add boost-uuid-comparison.patch: Fix regression in UUID operator<
- add boost-disable-pch-on-aarch64.patch: Disable pch on math library
  to avoid compiler segfault

OBS-URL: https://build.opensuse.org/request/show/306161
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/boost?expand=0&rev=144
2015-05-10 09:07:49 +00:00

32 lines
1.1 KiB
Diff

From 3e405b6fd5db5615bbef241763de070118222ca7 Mon Sep 17 00:00:00 2001
From: Stefan Seefeld <stefan@seefeld.name>
Date: Thu, 9 Apr 2015 08:57:08 -0400
Subject: [PATCH] Fix exec_file for Python 3 < 3.4.
---
src/exec.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/exec.cpp b/src/exec.cpp
index 2910db7..12cdabc 100644
--- a/libs/python/src/exec.cpp
+++ b/libs/python/src/exec.cpp
@@ -86,9 +86,12 @@ object BOOST_PYTHON_DECL exec_file(str filename, object global, object local)
char *f = python::extract<char *>(filename);
// Let python open the file to avoid potential binary incompatibilities.
-#if PY_VERSION_HEX >= 0x03000000
- // See http://www.codeproject.com/Articles/820116/Embedding-Python-program-in-a-C-Cplusplus-code
+#if PY_VERSION_HEX >= 0x03400000
FILE *fs = _Py_fopen(f, "r");
+#elif PY_VERSION_HEX >= 0x03000000
+ PyObject *fo = Py_BuildValue("s", f);
+ FILE *fs = _Py_fopen(fo, "r");
+ Py_DECREF(fo);
#else
PyObject *pyfile = PyFile_FromString(f, const_cast<char*>("r"));
if (!pyfile) throw std::invalid_argument(std::string(f) + " : no such file");
--
2.1.0