# Path: schemepy/exceptions.py
# class Error(Exception):
# class ConversionError(Error):
# class VMNotFoundError(Error):
# class ProfileNotFoundError(Error):
# class BackendNotFoundError(Error):
# class SchemeError(Error):
# class ScmSystemError(SchemeError):
# class ScmNumericalError(SchemeError):
# class ScmWrongArgType(SchemeError):
# class ScmWrongArgNumber(SchemeError):
# class ScmSyntaxError(SchemeError):
# class ScmUnboundVariable(SchemeError):
# class ScmMiscError(SchemeError):
#     def __str__(self):
#     def __init__(self, value, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
# 
# Path: schemepy/tpcl.py
# def setup(vm):


from ctypes.util import find_library
from ctypes import *
from schemepy.types import *
from schemepy import exceptions
from schemepy import tpcl
from _ctypes import Py_INCREF, Py_DECREF, PyObj_FromPtr
import types
import os.path
import init_mz
        if isinstance(env, tuple):
            env, post_hook = env
        
        self._module = mz.scheme_eval_string(env, global_env_ref)

        if post_hook:
            post_hook(self)

    def ensure_namespace(meth):
        """\
        Set the current namespace parameter before calling methods.
        """
        def decorated_meth(self, *args, **kw):
            mz.set_current_namespace(self._module)
            return meth(self, *args, **kw)
        return decorated_meth

    def filter_exception(meth):
        """\
        The decorator parse the return value of catched function calls,
        raise exceptions when necessary and return the filtered value
        otherwise.
        """
        def filtered_meth(self, *args, **kw):
            rlt = meth(self, *args, **kw)
            if self.fromscheme(mz.scheme_pair_car(rlt)) is True:
                return mz.scheme_pair_cdr(rlt)
            excp = mz.scheme_pair_cdr(rlt)
            ex_name = self.fromscheme(mz.scheme_pair_car(excp))
            ex_msg =  self.fromscheme(mz.scheme_pair_cdr(excp))

# Path: schemepy/exceptions.py
# class Error(Exception):
# class ConversionError(Error):
# class VMNotFoundError(Error):
# class ProfileNotFoundError(Error):
# class BackendNotFoundError(Error):
# class SchemeError(Error):
# class ScmSystemError(SchemeError):
# class ScmNumericalError(SchemeError):
# class ScmWrongArgType(SchemeError):
# class ScmWrongArgNumber(SchemeError):
# class ScmSyntaxError(SchemeError):
# class ScmUnboundVariable(SchemeError):
# class ScmMiscError(SchemeError):
#     def __str__(self):
#     def __init__(self, value, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
#     def __init__(self, message):
# 
# Path: schemepy/tpcl.py
# def setup(vm):


# Path: schemepy/mzscheme/mzscheme.py
from ctypes.util import find_library
from ctypes import *
from schemepy.types import *
from schemepy import exceptions
from schemepy import tpcl
from _ctypes import Py_INCREF, Py_DECREF, PyObj_FromPtr
import types
import os.path
import init_mz

        if isinstance(env, tuple):
            env, post_hook = env
        
        self._module = mz.scheme_eval_string(env, global_env_ref)

        if post_hook:
            post_hook(self)

    def ensure_namespace(meth):
        """\
        Set the current namespace parameter before calling methods.
        """
        def decorated_meth(self, *args, **kw):
            mz.set_current_namespace(self._module)
            return meth(self, *args, **kw)
        return decorated_meth

    def filter_exception(meth):
        """\
        The decorator parse the return value of catched function calls,
        raise exceptions when necessary and return the filtered value
        otherwise.
        """
        def filtered_meth(self, *args, **kw):
            rlt = meth(self, *args, **kw)
            if self.fromscheme(mz.scheme_pair_car(rlt)) is True:
                return mz.scheme_pair_cdr(rlt)
            excp = mz.scheme_pair_cdr(rlt)
            ex_name = self.fromscheme(mz.scheme_pair_car(excp))
            ex_msg =  self.fromscheme(mz.scheme_pair_cdr(excp))

            raise getattr(exceptions, ex_name)(ex_msg)