Merge ~cjwatson/launchpad:string-ascii into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 03432a5c554b33c238cd8275afe84c4484cdc29b
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:string-ascii
Merge into: launchpad:master
Diff against target: 50 lines (+5/-5)
3 files modified
lib/lp/bugs/adapters/treelookup.py (+1/-1)
lib/lp/services/testing/tests/test_customresult.py (+3/-3)
lib/lp/snappy/model/snapstoreclient.py (+1/-1)
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Review via email: mp+379799@code.launchpad.net

Commit message

Use string.ascii_{letters,lowercase}

Description of the change

Python 3 removed string.letters and string.lowercase.

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/bugs/adapters/treelookup.py b/lib/lp/bugs/adapters/treelookup.py
2index 45acab5..3c35c22 100644
3--- a/lib/lp/bugs/adapters/treelookup.py
4+++ b/lib/lp/bugs/adapters/treelookup.py
5@@ -110,7 +110,7 @@ class LookupBranch:
6 else:
7 return format % self.result.describe(level)
8
9- _describe_key_chars = set(string.letters + string.digits + '-_+=*')
10+ _describe_key_chars = set(string.ascii_letters + string.digits + '-_+=*')
11
12 def _describe_key(self, key):
13 """Return a pretty representation of a simple key.
14diff --git a/lib/lp/services/testing/tests/test_customresult.py b/lib/lp/services/testing/tests/test_customresult.py
15index 338ca2e..0baf596 100644
16--- a/lib/lp/services/testing/tests/test_customresult.py
17+++ b/lib/lp/services/testing/tests/test_customresult.py
18@@ -41,7 +41,7 @@ class TestFilterTests(TestCase):
19 f.flush()
20
21 @staticmethod
22- def make_suite(testnames=string.lowercase):
23+ def make_suite(testnames=string.ascii_lowercase):
24 """Make a suite containing `testnames` (default: 'a'..'z')."""
25 suite = unittest.TestSuite()
26 for testname in testnames:
27@@ -55,8 +55,8 @@ class TestFilterTests(TestCase):
28 The first has 'a'..'m' and the second 'n'..'z'.
29 """
30 return (
31- TestFilterTests.make_suite(string.lowercase[:13]),
32- TestFilterTests.make_suite(string.lowercase[13:]),
33+ TestFilterTests.make_suite(string.ascii_lowercase[:13]),
34+ TestFilterTests.make_suite(string.ascii_lowercase[13:]),
35 )
36
37 @staticmethod
38diff --git a/lib/lp/snappy/model/snapstoreclient.py b/lib/lp/snappy/model/snapstoreclient.py
39index 7d094aa..9d007de 100644
40--- a/lib/lp/snappy/model/snapstoreclient.py
41+++ b/lib/lp/snappy/model/snapstoreclient.py
42@@ -83,7 +83,7 @@ class MacaroonAuth(requests.auth.AuthBase):
43 """Attaches macaroon authentication to a given Request object."""
44
45 # The union of the base64 and URL-safe base64 alphabets.
46- allowed_chars = set(string.digits + string.letters + "+/=-_")
47+ allowed_chars = set(string.digits + string.ascii_letters + "+/=-_")
48
49 def __init__(self, root_macaroon_raw, unbound_discharge_macaroon_raw=None,
50 logger=log):

Subscribers

People subscribed via source and target branches

to status/vote changes: