Skip to content

Commit

Permalink
Fixed getting/setting char properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayuto committed May 11, 2016
1 parent 454efc5 commit ee21df2
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,7 @@ def fget(ptr):

# Does the value need cast to an integer?
if type_name == 'char':
if value == '\x00':
return 0
return int(value)
return ord(value)
return value

# Return the value
Expand All @@ -574,9 +572,7 @@ def fset(ptr, value):

# Does the value need cast to a string?
if type_name == 'char':
if not value:
value = '\x00'
value = str(value)
value = chr(value)

# Set the property
getattr(ptr, 'set_' + type_name)(value, offset)
Expand Down

0 comments on commit ee21df2

Please sign in to comment.