summaryrefslogtreecommitdiff
path: root/examples/chess.py
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2017-09-15 20:42:01 +0300
committerVille Skyttä <ville.skytta@iki.fi>2017-09-17 08:26:55 +0300
commit989816d3a6b8cab160608543f36b9f76528eb2fa (patch)
tree25336b4ac4f0c8324db0e479a6adf19c4ea257d9 /examples/chess.py
parent11445503eab6ac8356f25a6d5dbfa7208abddab7 (diff)
downloadpexpect-git-989816d3a6b8cab160608543f36b9f76528eb2fa.tar.gz
Python 3.6 invalid escape sequence deprecation fixes
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
Diffstat (limited to 'examples/chess.py')
-rwxr-xr-xexamples/chess.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/chess.py b/examples/chess.py
index 421727d..f97a3a9 100755
--- a/examples/chess.py
+++ b/examples/chess.py
@@ -29,8 +29,8 @@ from __future__ import absolute_import
import pexpect
import ANSI
-REGEX_MOVE = '(?:[a-z]|\x1b\[C)(?:[0-9]|\x1b\[C)(?:[a-z]|\x1b\[C)(?:[0-9]|\x1b\[C)'
-REGEX_MOVE_PART = '(?:[0-9]|\x1b\[C)(?:[a-z]|\x1b\[C)(?:[0-9]|\x1b\[C)'
+REGEX_MOVE = r'(?:[a-z]|\x1b\[C)(?:[0-9]|\x1b\[C)(?:[a-z]|\x1b\[C)(?:[0-9]|\x1b\[C)'
+REGEX_MOVE_PART = r'(?:[0-9]|\x1b\[C)(?:[a-z]|\x1b\[C)(?:[0-9]|\x1b\[C)'
class Chess:
@@ -71,7 +71,7 @@ class Chess:
def get_computer_move (self):
print('Here')
- i = self.child.expect (['\[17;59H', '\[17;58H'])
+ i = self.child.expect ([r'\[17;59H', r'\[17;58H'])
print(i)
if i == 0:
self.child.expect (REGEX_MOVE)