Updating to python 3 with 2to3. Check llvm/py3k_update.diff and llvm/py3k_update.out for the output from this.
This commit is contained in:
parent
ddbe7ad06a
commit
6d50a337ad
29 changed files with 3455 additions and 143 deletions
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"""
|
||||
|
||||
VERSION = '0.6'
|
||||
VERSION = '0.7'
|
||||
|
||||
from weakref import WeakValueDictionary
|
||||
|
||||
|
|
@ -68,12 +68,12 @@ class Ownable(object):
|
|||
|
||||
def _own(self, owner):
|
||||
if self.owner:
|
||||
raise LLVMException, "object already owned"
|
||||
raise LLVMException("object already owned")
|
||||
self.owner = owner
|
||||
|
||||
def _disown(self):
|
||||
if not self.owner:
|
||||
raise LLVMException, "not owned"
|
||||
raise LLVMException("not owned")
|
||||
self.owner = None
|
||||
|
||||
def __del__(self):
|
||||
|
|
@ -135,15 +135,13 @@ class _ObjectCache(type):
|
|||
# Cacheables
|
||||
#===----------------------------------------------------------------------===
|
||||
|
||||
class Cacheable(object):
|
||||
class Cacheable(object, metaclass=_ObjectCache):
|
||||
"""Objects that can be cached.
|
||||
|
||||
Objects that wrap a PyCObject are cached to avoid "aliasing", i.e.,
|
||||
two Python objects each containing a PyCObject which internally points
|
||||
to the same C pointer."""
|
||||
|
||||
__metaclass__ = _ObjectCache
|
||||
|
||||
def forget(self):
|
||||
_ObjectCache.forget(self)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue