Python __builtin__ 模块,Exception() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用__builtin__.Exception()

项目:dingdang-robot    作者:wzpan    | 项目源码 | 文件源码
def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
项目:dingdang-robot    作者:wzpan    | 项目源码 | 文件源码
def __init__(self, resource_filename, model_str):
        this = _snowboydetect.new_SnowboyDetect(resource_filename, model_str)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, nelements: 'size_t'):
        this = _YASHE.new_intArray(nelements)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, *args):
        this = _YASHE.new_ciphertext(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, *args):
        this = _YASHE.new_secret_key(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, *args):
        this = _YASHE.new_public_key(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self):
        this = _YASHE.new_key_gen()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, *args):
        this = _YASHE.new_pari_GEN(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self):
        this = _YASHE.new_parameters()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, nelements: 'size_t'):
        this = _YASHE.new_intArray(nelements)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, *args):
        this = _YASHE.new_secret_key(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, *args):
        this = _YASHE.new_public_key(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self):
        this = _YASHE.new_key_pair()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self):
        this = _YASHE.new_key_gen()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, *args):
        this = _YASHE.new_pari_GEN(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, nelements: 'size_t'):
        this = _YASHE.new_intArray(nelements)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, *args):
        this = _YASHE.new_ciphertext(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, *args):
        this = _YASHE.new_secret_key(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, *args):
        this = _YASHE.new_public_key(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self):
        this = _YASHE.new_key_gen()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self, *args):
        this = _YASHE.new_pari_GEN(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:PyYashe    作者:OpenMined    | 项目源码 | 文件源码
def __init__(self):
        this = _YASHE.new_parameters()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:Hands-Free-Presentation    作者:chrishorton    | 项目源码 | 文件源码
def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
项目:Hands-Free-Presentation    作者:chrishorton    | 项目源码 | 文件源码
def __init__(self, resource_filename, model_str):
        this = _snowboydetect.new_SnowboyDetect(resource_filename, model_str)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:google-voice    作者:max246    | 项目源码 | 文件源码
def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
项目:google-voice    作者:max246    | 项目源码 | 文件源码
def __init__(self, resource_filename, model_str):
        this = _snowboydetect.new_SnowboyDetect(resource_filename, model_str)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self, name: 'std::string const &', problem_type: 'operations_research::MPSolver::OptimizationProblemType'):
        this = _pywraplp.new_Solver(name, problem_type)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self):
        this = _pywraplp.new_MPSolverParameters()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self, *args):
        this = _pywrapknapsack_solver.new_KnapsackSolver(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self):
        this = _pywrapcp.new_DefaultPhaseParameters()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self, *args):
        this = _pywrapcp.new_Solver(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this

        self.__python_constraints = []
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self):
        if self.__class__ == BaseObject:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_BaseObject(_self, )
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self, s: 'Solver'):
        if self.__class__ == PropagationBaseObject:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_PropagationBaseObject(_self, s)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self):
        if self.__class__ == Decision:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_Decision(_self, )
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self):
        if self.__class__ == Demon:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_Demon(_self, )
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self, solver: 'Solver'):
        if self.__class__ == Constraint:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_Constraint(_self, solver)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self, s: 'Solver'):
        if self.__class__ == SearchMonitor:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_SearchMonitor(_self, s)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self, val: 'long long const &'):
        this = _pywrapcp.new_RevInteger(val)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self, val: 'long long const &'):
        this = _pywrapcp.new_NumericalRevInteger(val)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self, *args):
        if self.__class__ == IntVarLocalSearchOperator:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_IntVarLocalSearchOperator(_self, *args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self, vars: 'std::vector< operations_research::IntVar *,std::allocator< operations_research::IntVar * > > const &'):
        if self.__class__ == BaseLns:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_BaseLns(_self, vars)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self, vars: 'std::vector< operations_research::IntVar *,std::allocator< operations_research::IntVar * > > const &'):
        if self.__class__ == ChangeValue:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_ChangeValue(_self, vars)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def __init__(self, vars: 'std::vector< operations_research::IntVar *,std::allocator< operations_research::IntVar * > > const &'):
        if self.__class__ == IntVarLocalSearchFilter:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_IntVarLocalSearchFilter(_self, vars)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def ApplyWrapper(self, solver):
    try:
       self.Apply(solver)
    except Exception as e:
      if 'CP Solver fail' in str(e):
        solver.ShouldFail()
      else:
        raise
项目:aws_lambda_ortools    作者:tunamonster    | 项目源码 | 文件源码
def NextWrapper(self, solver):
    try:
      return self.Next(solver)
    except Exception as e:
      if 'CP Solver fail' in str(e):
        return solver.FailDecision()
      else:
        raise