Skip to content

Commit

Permalink
Make regular expressions in test_tasks.py raw strings. (GH-8759)
Browse files Browse the repository at this point in the history
Follow up to bpo-34270.

Fixes:
```
Lib/test/test_asyncio/test_tasks.py:330: DeprecationWarning: invalid escape sequence \d
  match1 = re.match("^<Task pending name='Task-(\d+)'", repr(t1))
Lib/test/test_asyncio/test_tasks.py:332: DeprecationWarning: invalid escape sequence \d
  match2 = re.match("^<Task pending name='Task-(\d+)'", repr(t2))
```
  • Loading branch information
benjaminp committed Aug 14, 2018
1 parent da12063 commit aa4e4a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/test/test_asyncio/test_tasks.py
Expand Up @@ -327,9 +327,9 @@ def notmuch():
t2 = self.new_task(self.loop, notmuch(), None)
self.assertNotEqual(repr(t1), repr(t2))

match1 = re.match("^<Task pending name='Task-(\d+)'", repr(t1))
match1 = re.match(r"^<Task pending name='Task-(\d+)'", repr(t1))
self.assertIsNotNone(match1)
match2 = re.match("^<Task pending name='Task-(\d+)'", repr(t2))
match2 = re.match(r"^<Task pending name='Task-(\d+)'", repr(t2))
self.assertIsNotNone(match2)

# Autogenerated task names should have monotonically increasing numbers
Expand Down

0 comments on commit aa4e4a4

Please sign in to comment.