The error was trying to set fewer axes than there currently are; it gives the popup instead of printing when running it from a button:
# run with a font having a few axes
from vanilla import Window, Button
class Test:
def __init__(self):
W, H = 100, 100
self.w = Window((W, H))
self.w.buttom = Button((10, 10, -10, -10), 'Run', callback = self.run)
self.w.open()
def run( self, sender ):
for master in Font.masters:
newAxes = master.axes[0:-1]
master.axes = newAxes
Test()