From 0536dad8ab9a27d9a29379a8865aad597bedcdce Mon Sep 17 00:00:00 2001 From: Haoyu Bai Date: Fri, 10 Jul 2009 16:47:17 +0000 Subject: [PATCH] remove decode() method in str wrapper for py3k [SVN r54862] --- include/boost/python/str.hpp | 4 ++++ src/str.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/include/boost/python/str.hpp b/include/boost/python/str.hpp index 024d8eaf..426a3a25 100644 --- a/include/boost/python/str.hpp +++ b/include/boost/python/str.hpp @@ -37,10 +37,12 @@ namespace detail long count(object_cref sub, object_cref start, object_cref end) const; +#if PY_VERSION_HEX < 0x03000000 object decode() const; object decode(object_cref encoding) const; object decode(object_cref encoding, object_cref errors) const; +#endif object encode() const; object encode(object_cref encoding) const; @@ -185,6 +187,7 @@ class str : public detail::str_base return base::count(object(sub), object(start)); } +#if PY_VERSION_HEX < 0x03000000 object decode() const { return base::decode(); } template @@ -198,6 +201,7 @@ class str : public detail::str_base { return base::decode(object(encoding),object(errors)); } +#endif object encode() const { return base::encode(); } diff --git a/src/str.cpp b/src/str.cpp index 24d62dd7..fb17f855 100644 --- a/src/str.cpp +++ b/src/str.cpp @@ -115,6 +115,7 @@ long str_base::count(object_cref sub, object_cref start, object_cref end) const return extract(this->attr("count")(sub,start,end)); } +#if PY_VERSION_HEX < 0x03000000 object str_base::decode() const { return this->attr("decode")(); @@ -129,6 +130,7 @@ object str_base::decode(object_cref encoding, object_cref errors) const { return this->attr("decode")(encoding,errors); } +#endif object str_base::encode() const {