Skip to content

Commit

Permalink
wxGUI vnet: fix ctypes c_char_p arg type (bytes object) (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi authored and petrasovaa committed Jun 4, 2020
1 parent cb8f668 commit 23dd5c5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gui/wxpython/vnet/vnet_utils.py
Expand Up @@ -20,6 +20,7 @@

import math
from grass.script import core as grass
from grass.script.utils import encode

try:
import grass.lib.vector as vectlib
Expand Down Expand Up @@ -58,8 +59,8 @@ def SnapToNode(e, n, tresh, vectMap):

openedMap = pointer(vectlib.Map_info())
ret = vectlib.Vect_open_old(openedMap,
c_char_p(vectMap),
c_char_p(mapSet))
c_char_p(encode(vectMap)),
c_char_p(encode(mapSet)))
if ret == 1:
vectlib.Vect_close(openedMap)
if ret != 2:
Expand Down Expand Up @@ -98,8 +99,8 @@ def GetNearestNodeCat(e, n, layer, tresh, vectMap):

openedMap = pointer(vectlib.Map_info())
ret = vectlib.Vect_open_old(openedMap,
c_char_p(vectMapName),
c_char_p(mapSet))
c_char_p(encode(vectMapName)),
c_char_p(encode(mapSet)))
if ret == 1:
vectlib.Vect_close(openedMap)
if ret != 2:
Expand Down

0 comments on commit 23dd5c5

Please sign in to comment.