Merge ~cjwatson/launchpad:py3-contrib-glock-bool-constants into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 15ec8a421c2399c70a0d0c94f9d81d3049021a83
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-contrib-glock-bool-constants
Merge into: launchpad:master
Diff against target: 16 lines (+0/-5)
1 file modified
lib/contrib/glock.py (+0/-5)
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Review via email: mp+380594@code.launchpad.net

Commit message

Remove pre-2.2 compatibility from contrib.glock

Description of the change

Assigning to True and False is a SyntaxError in Python 3, even if it's guarded by a conditional that's always false at run-time.

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/contrib/glock.py b/lib/contrib/glock.py
2index e1a7364..d1ced09 100644
3--- a/lib/contrib/glock.py
4+++ b/lib/contrib/glock.py
5@@ -73,11 +73,6 @@ class LockAlreadyAcquired(GlobalLockError):
6 pass
7
8
9-# Constants
10-# ---------:
11-if sys.version[:3] < '2.2':
12- True, False = 1, 0 # built-in in Python 2.2+
13-
14 #----------------------------------------------------------------------------
15 class GlobalLock:
16 #----------------------------------------------------------------------------

Subscribers

People subscribed via source and target branches

to status/vote changes: