diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2017-09-15 20:42:01 +0300 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2017-09-17 08:26:55 +0300 |
commit | 989816d3a6b8cab160608543f36b9f76528eb2fa (patch) | |
tree | 25336b4ac4f0c8324db0e479a6adf19c4ea257d9 /examples/chess3.py | |
parent | 11445503eab6ac8356f25a6d5dbfa7208abddab7 (diff) | |
download | pexpect-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/chess3.py')
-rwxr-xr-x | examples/chess3.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/chess3.py b/examples/chess3.py index dc02663..2c087b0 100755 --- a/examples/chess3.py +++ b/examples/chess3.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: @@ -74,7 +74,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) |