Merge lp:~gz/brz/fifo_future_division into lp:brz

Proposed by Martin Packman
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~gz/brz/fifo_future_division
Merge into: lp:brz
Diff against target: 48 lines (+5/-5)
1 file modified
breezy/fifo_cache.py (+5/-5)
To merge this branch: bzr merge lp:~gz/brz/fifo_future_division
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+325125@code.launchpad.net

Commit message

Ensure fifo_cache uses integer division on Python 3

Description of the change

Divide the future! No tests fail without this change, but keeping things ints on PY3 makes sense anyway.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Running landing tests failed
http://10.242.247.184:8080/job/brz-dev/73/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/fifo_cache.py'
2--- breezy/fifo_cache.py 2017-06-05 20:48:31 +0000
3+++ breezy/fifo_cache.py 2017-06-05 23:20:35 +0000
4@@ -16,7 +16,7 @@
5
6 """A simple first-in-first-out (FIFO) cache."""
7
8-from __future__ import absolute_import
9+from __future__ import absolute_import, division
10
11 from collections import deque
12
13@@ -28,7 +28,7 @@
14 dict.__init__(self)
15 self._max_cache = max_cache
16 if after_cleanup_count is None:
17- self._after_cleanup_count = self._max_cache * 8 / 10
18+ self._after_cleanup_count = self._max_cache * 8 // 10
19 else:
20 self._after_cleanup_count = min(after_cleanup_count,
21 self._max_cache)
22@@ -123,7 +123,7 @@
23 """
24 self._max_cache = max_cache
25 if after_cleanup_count is None:
26- self._after_cleanup_count = max_cache * 8 / 10
27+ self._after_cleanup_count = max_cache * 8 // 10
28 else:
29 self._after_cleanup_count = min(max_cache, after_cleanup_count)
30 if len(self) > self._max_cache:
31@@ -193,7 +193,7 @@
32 FIFOCache.__init__(self, max_cache=max_size)
33 self._max_size = max_size
34 if after_cleanup_size is None:
35- self._after_cleanup_size = self._max_size * 8 / 10
36+ self._after_cleanup_size = self._max_size * 8 // 10
37 else:
38 self._after_cleanup_size = min(after_cleanup_size, self._max_size)
39
40@@ -262,7 +262,7 @@
41 FIFOCache.resize(self, max_size)
42 self._max_size = max_size
43 if after_cleanup_size is None:
44- self._after_cleanup_size = max_size * 8 / 10
45+ self._after_cleanup_size = max_size * 8 // 10
46 else:
47 self._after_cleanup_size = min(max_size, after_cleanup_size)
48 if self._value_size > self._max_size:

Subscribers

People subscribed via source and target branches