Skip to content
Snippets Groups Projects
Commit 91be47a0 authored by Richard Berger's avatar Richard Berger
Browse files

Revert type checking commit from July

0aebb2eabea6ae3f5365951335ac3d698ab9ad9e
parent ab92529b
No related branches found
No related tags found
No related merge requests found
...@@ -133,14 +133,11 @@ class lammps(object): ...@@ -133,14 +133,11 @@ class lammps(object):
# self.lmp = self.lib.lammps_open_no_mpi(0,None) # self.lmp = self.lib.lammps_open_no_mpi(0,None)
else: else:
if isinstance(ptr,lammps): self.opened = 0
# magic to convert ptr to ctypes ptr # magic to convert ptr to ctypes ptr
pythonapi.PyCObject_AsVoidPtr.restype = c_void_p pythonapi.PyCObject_AsVoidPtr.restype = c_void_p
pythonapi.PyCObject_AsVoidPtr.argtypes = [py_object] pythonapi.PyCObject_AsVoidPtr.argtypes = [py_object]
self.lmp = c_void_p(pythonapi.PyCObject_AsVoidPtr(ptr)) self.lmp = c_void_p(pythonapi.PyCObject_AsVoidPtr(ptr))
else:
self.lmp = None
raise TypeError('Unsupported type passed as "ptr"')
def __del__(self): def __del__(self):
if self.lmp and self.opened: self.lib.lammps_close(self.lmp) if self.lmp and self.opened: self.lib.lammps_close(self.lmp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment