Use raw strings to get rid of DeprecationWarning

DeprecationWarning is for invalid escape sequence ('\'). Decided to use
raw strings rather than double-backslashes because the text processing
is using raw strings anwyay.
This commit is contained in:
Kenneth Lyons 2020-09-20 09:36:21 -07:00
parent b058d032d1
commit 16ea8ada0c

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
# based on https://github.com/art1415926535/PyQt5-syntax-highlighting # based on https://github.com/art1415926535/PyQt5-syntax-highlighting
from pyqtgraph.Qt import QtCore, QtGui from pyqtgraph.Qt import QtCore, QtGui
@ -117,20 +118,20 @@ class PythonHighlighter(QSyntaxHighlighter):
# Python operators # Python operators
operators = [ operators = [
'=', r'=',
# Comparison # Comparison
'==', '!=', '<', '<=', '>', '>=', r'==', r'!=', r'<', r'<=', r'>', r'>=',
# Arithmetic # Arithmetic
'\+', '-', '\*', '/', '//', '\%', '\*\*', r'\+', r'-', r'\*', r'/', r'//', r'\%', r'\*\*',
# In-place # In-place
'\+=', '-=', '\*=', '/=', '\%=', r'\+=', r'-=', r'\*=', r'/=', r'\%=',
# Bitwise # Bitwise
'\^', '\|', '\&', '\~', '>>', '<<', r'\^', r'\|', r'\&', r'\~', r'>>', r'<<',
] ]
# Python braces # Python braces
braces = [ braces = [
'\{', '\}', '\(', '\)', '\[', '\]', r'\{', r'\}', r'\(', r'\)', r'\[', r'\]',
] ]
def __init__(self, document): def __init__(self, document):