except KeyboardInterrupt, e

来源:互联网 发布:萍乡网络电视台 编辑:程序博客网 时间:2024/06/07 21:52

https://linuxconfig.org/how-to-switch-between-python-versions-on-fedora-linux

Known problems with Fedora Linux and Python 3 version: Error message:

# yum search package  File "/usr/bin/yum", line 30    except KeyboardInterrupt, e:                            ^SyntaxError: invalid syntax
If you set python3 globally on your system change the yumshebang to python2:
# vi /usr/bin/yumFROM:#!/usr/bin/pythonTO:#!/usr/bin/python2.7
Similarly: Error message:
Downloading packages:  File "/usr/libexec/urlgrabber-ext-down", line 28    except OSError, e:                  ^SyntaxError: invalid syntaxExiting on user cancel
The issue is also related to Python 3 set as a default global version. To fix this error update/usr/libexec/urlgrabber-ext-down script:
# vi /usr/libexec/urlgrabber-ext-downFROM:#!/usr/bin/pythonTO:#!/usr/bin/python2.7
阅读全文
0 0
原创粉丝点击