Skip to content

Commit

Permalink
nbt.name no longer results in an error in python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
agrif committed May 7, 2012
1 parent 52375ee commit e32e8ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bindings/redstone.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,15 @@ def __new__(cls, name, bases, dct):
ctype, pytype, convert, check = getattr(p, propname)
except ValueError:
ctype, pytype, convert = getattr(p, propname)
check = lambda o: True
check = None
propname = propname.rstrip('_')
getmeth = getattr(rs, prefix + 'get_' + propname)
setmeth = getattr(rs, prefix + 'set_' + propname)

if not convert:
convert = lambda s: s
if not check:
check = lambda o: True

getmeth.restype = ctype
getmeth.argtypes = [c_void_p]
Expand Down Expand Up @@ -746,7 +748,7 @@ class Methods:
write_to_region = (c_bool, [c_void_p, c_void_p, c_uint8, c_uint8])
write_to_file = (c_bool, [c_void_p, c_char_p])
class Properties:
name = (c_char_p, str, None, None)
name = (c_char_p, str, None)
root = (c_void_p, Tag, lambda ptr: Tag(ptr, True) if ptr else None)

@classmethod
Expand Down

0 comments on commit e32e8ea

Please sign in to comment.