2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-21 17:12:22 +00:00
Files
python/errors.h
Dave Abrahams 0f04631513 lowercase type names
[SVN r8284]
2000-11-22 00:54:46 +00:00

31 lines
832 B
C++

// (C) Copyright David Abrahams 2000. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
//
// The author gratefully acknowleges the support of Dragon Systems, Inc., in
// producing this work.
#ifndef ERRORS_DWA052500_H_
# define ERRORS_DWA052500_H_
namespace python {
struct error_already_set {};
struct argument_error : error_already_set {};
// Handles exceptions caught just before returning to Python code.
void handle_exception();
template <class T>
T* expect_non_null(T* x)
{
if (x == 0)
throw error_already_set();
return x;
}
} // namespace python
#endif // ERRORS_DWA052500_H_