Skip to content

Commit

Permalink
[Mod] use autocxxpy 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nanoric committed Jul 3, 2019
1 parent ee717a6 commit 50a212b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
12 changes: 2 additions & 10 deletions vnpy/api/oes/generate_oes.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
#!/usr/bin/env bash

script_autocxxpy_version="autocxxpy 0.4.0"
autocxxpy_version=`python -m autocxxpy version`
if [[ $autocxxpy_version != $script_autocxxpy_version ]]; then
echo "autocxxpy version not match!"
echo "current: " $autocxxpy_version
echo "script: " $script_autocxxpy_version
echo "to continue, change version of autocxxpy or modify this script."
exit 1
fi
python -m autocxxpy generate \
vnoes \
oes_api/oes_api.h \
Expand All @@ -19,7 +10,8 @@ python -m autocxxpy generate \
--copy-autocxxpy-includes vnoes/include \
--pyi-output-dir .\
--no-clear-pyi-output-dir \
--no-callback-pattern ".*"
--no-callback-pattern ".*" \
--enforce-version 0.4.1

#####################################
# of unsupported functions: 5
Expand Down
12 changes: 9 additions & 3 deletions vnpy/api/oes/vnoes/include/autocxxpy/callback_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,23 @@ namespace autocxxpy
struct async_dispatch_exception : public std::exception
{
async_dispatch_exception(const char *what, const pybind11::object &instance, std::string function_name)
: std::exception(what), instance(instance), function_name(function_name)
: _what(what), instance(instance), function_name(function_name)
{}
std::string _what;
pybind11::object instance;
std::string function_name;

// mutable version of what() for pybind11 to make it happy
inline const char* what_mutable() noexcept
{
return std::exception::what();
return what();
}
};

virtual char const* what() const override
{
return _what.c_str();
}
};

struct async_callback_exception_handler
{
Expand Down

0 comments on commit 50a212b

Please sign in to comment.