Use PyObject_AsFileDescriptor() instead of object type comparison
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 28 Oct 2009 13:55:35 +0000 (15:55 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 28 Oct 2009 13:55:35 +0000 (15:55 +0200)
commita5e123bc3e07fa6cc3fad13bc7f8a471ecb17d9b
treeacc2bc3bf4182a92e4c8282618ba04c3d6489a9f
parent590914c32c1d514d1a4e5c2244e1e38548a2e87d
Use PyObject_AsFileDescriptor() instead of object type comparison
- this permits any file-like object implementing .fileno() method
  (including rpm.fd) to be dup'ed, not just PyFile subtypes
- this also avoids yet another incompatibility with Python 3 which doesn't
  have PyFile_Check() and PyFile_AsFile() at all
python/rpmfd-py.c