Commit 91be47a0 authored by Richard Berger's avatar Richard Berger
Browse files

Revert type checking commit from July

0aebb2eabea6ae3f5365951335ac3d698ab9ad9e
parent ab92529b
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -133,14 +133,11 @@ class lammps(object):
          # self.lmp = self.lib.lammps_open_no_mpi(0,None)

    else:
      if isinstance(ptr,lammps):
      self.opened = 0
      # magic to convert ptr to ctypes ptr
      pythonapi.PyCObject_AsVoidPtr.restype = c_void_p
      pythonapi.PyCObject_AsVoidPtr.argtypes = [py_object]
      self.lmp = c_void_p(pythonapi.PyCObject_AsVoidPtr(ptr))
      else:
        self.lmp = None
        raise TypeError('Unsupported type passed as "ptr"')

  def __del__(self):
    if self.lmp and self.opened: self.lib.lammps_close(self.lmp)