aaron212 / pynfc

Automatically exported from code.google.com/p/pynfc
GNU General Public License v2.0
0 stars 0 forks source link

Crash when using poll_targets() #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
With the snippet:

mod_targets = (
    pynfc.Modulation(nmt=nfc.NMT_ISO14443A, nbr=nfc.NBR_UNDEFINED),
    pynfc.Modulation(nmt=nfc.NMT_ISO14443B, nbr=nfc.NBR_UNDEFINED),
)

targets = nfc.poll_targets(mod_targets, 20, 2)

=> crash with:

Traceback (most recent call last):
  File "testnfc.py", line 33, in <module>
    targets = nfc.poll_targets(mod_targets, 20, 2)
  File "pynfc.py", line 566, in poll_targets
    return self.initiator_poll_targets(*args, **kwargs)
  File "pynfc.py", line 366, in initiator_poll_targets
    targtypes[i] = targetlist[i]
TypeError: '_ctypes.PyCArrayType' object does not support item assignment

Patch attached.

Original issue reported on code.google.com by txprog on 27 Sep 2011 at 11:07

Attachments: