Skip to content

Commit 4f65cc9

Browse files
committed
more fix
1 parent a2e034b commit 4f65cc9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/pybind11/pytypes.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ PYBIND11_NAMESPACE_BEGIN(detail)
319319
inline std::string error_string();
320320
PYBIND11_NAMESPACE_END(detail)
321321

322+
#if defined(_MSC_VER)
323+
# pragma warning(push)
324+
# pragma warning(disable: 4275) // warning C4275: An exported class was derived from a class that wasn't exported. Can be ignored when derived from a STL class.
325+
#endif
322326
/// Fetch and hold an error which was already set in Python. An instance of this is typically
323327
/// thrown to propagate python-side errors back through C++ which can either be caught manually or
324328
/// else falls back to the function dispatcher (which then raises the captured error back to
@@ -371,6 +375,9 @@ class PYBIND11_EXPORT error_already_set : public std::runtime_error {
371375
private:
372376
object m_type, m_value, m_trace;
373377
};
378+
#if defined(_MSC_VER)
379+
# pragma warning(pop)
380+
#endif
374381

375382
/** \defgroup python_builtins _
376383
Unless stated otherwise, the following C++ functions behave the same

0 commit comments

Comments
 (0)