Robot Framework启动ride.py失败的解决方法

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/chuhe163/article/details/102545160


1、问题描述

  • ride.py启动失败,提示信息如下
    在这里插入图片描述
  • 各版本安装包如下
    在这里插入图片描述

2、问题处理

  • 找到D:\Program Files\Python3.7.1_x64\Lib\site-packages\robotide\contrib\testrunner\testrunnerplugin.py

在这里插入图片描述

  • 修改以下代码
  • 下面是修改前的代码
    def _create_font(self):
        font=wx.SystemSettings.GetFont(wx.SYS_ANSI_FIXED_FONT)
        if not font.IsFixedWidth():
            # fixed width fonts are typically a little bigger than their
            # variable width peers so subtract one from the point size.
            font = wx.Font(font.GetPointSize()-1, wx.FONTFAMILY_MODERN,
                           wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
        return font
  • 修改后代码如下
    def _create_font(self):
        #font= wx.SystemSettings.GetFont(wx.SYS_ANSI_FIXED_FONT) #这是默认的,会报错
        #set a number in [0-8,10,13],then run ride successfully,SYS_SYSTEM_FONT=13,represents system font
        #在[0-8,10,13]中设置一个数字,然后成功运行ride,SYS_SYSTEM_FONT=13,表示系统字体
        font = wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FONT)
        if not font.IsFixedWidth():
            # fixed width fonts are typically a little bigger than their
            # variable width peers so subtract one from the point size.
            font = wx.Font(font.GetPointSize()-1, wx.FONTFAMILY_MODERN,
                           wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
        return font

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/chuhe163/article/details/102545160
今日推荐