diff options
author | Baruch Sterin <baruchs@gmail.com> | 2014-10-28 18:42:14 -0700 |
---|---|---|
committer | Baruch Sterin <baruchs@gmail.com> | 2014-10-28 18:42:14 -0700 |
commit | c2ccf238fd4081c938618c5251ed26085716fa34 (patch) | |
tree | 3a8933c80f766a6dcae2c8331109dd80947772e4 /src/python/pyabc.i | |
parent | 4edc0234797331d22675f35c61d1d3f12653792a (diff) | |
download | abc-c2ccf238fd4081c938618c5251ed26085716fa34.tar.gz abc-c2ccf238fd4081c938618c5251ed26085716fa34.tar.bz2 abc-c2ccf238fd4081c938618c5251ed26085716fa34.zip |
pyabc: handle a few corner cases
Diffstat (limited to 'src/python/pyabc.i')
-rw-r--r-- | src/python/pyabc.i | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/python/pyabc.i b/src/python/pyabc.i index 2b09a256..91c52872 100644 --- a/src/python/pyabc.i +++ b/src/python/pyabc.i @@ -744,15 +744,21 @@ void _set_death_signal(); class _Cex(object): def __new__(cls, pCex): + if not pCex: - return None + return None + + if int(pCex)==1: + return True + return object.__new__(cls) def __init__(self, pCex): self.pCex = pCex def __del__(self): - _cex_free(self.pCex) + if _cex_free: + _cex_free(self.pCex) def n_regs(self): return _cex_n_regs(self.pCex) |