Skip to content

Commit

Permalink
Fix errors when compiling Argos with the latest Cython
Browse files Browse the repository at this point in the history
    - Fixes `NameError: name 'extract_value' is not defined` error
    - Fixes segfault when trying to start Argos

Fixes #465, #490, #492
  • Loading branch information
bdutro authored and klingaard committed Apr 29, 2024
1 parent d2d1a4f commit 102a119
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions helios/pipeViewer/pipe_view/core/src/core.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import math
import colorsys
from logging import debug, error, info

# Color expression namespace
EXPR_NAMESPACE = {'re':re, 'colorsys':colorsys, 'math':math, 'extract':extract_value}

from common cimport *
from libc.stdlib cimport strtoul
from libcpp.unordered_map cimport unordered_map
Expand Down Expand Up @@ -203,6 +200,9 @@ cdef wxFont* getFont(font):
cdef wxBrush* getBrush(brush):
return getBrush_wrapped(<PyObject*>brush)

# Color expression namespace
EXPR_NAMESPACE = {'re':re, 'colorsys':colorsys, 'math':math, 'extract':extract_value}

cdef class Renderer:

cdef unordered_map[int, wxPen] c_pens_map
Expand Down Expand Up @@ -406,7 +406,8 @@ cdef class Renderer:
return string_to_display, wx.TheBrushList.FindOrCreateBrush(wx.WHITE, wx.SOLID)

def setFontFromDC(self, dc):
self.c_font = getFont(dc.GetFont())[0]
py_font = dc.GetFont()
self.c_font = getFont(py_font)[0]
self.c_bold_font = wxFont(self.c_font)
self.c_bold_font.MakeBold()

Expand Down

0 comments on commit 102a119

Please sign in to comment.