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
=== modified file 'breezy/fifo_cache.py'
--- breezy/fifo_cache.py 2017-06-05 20:48:31 +0000
+++ breezy/fifo_cache.py 2017-06-05 23:20:35 +0000
@@ -16,7 +16,7 @@
1616
17"""A simple first-in-first-out (FIFO) cache."""17"""A simple first-in-first-out (FIFO) cache."""
1818
19from __future__ import absolute_import19from __future__ import absolute_import, division
2020
21from collections import deque21from collections import deque
2222
@@ -28,7 +28,7 @@
28 dict.__init__(self)28 dict.__init__(self)
29 self._max_cache = max_cache29 self._max_cache = max_cache
30 if after_cleanup_count is None:30 if after_cleanup_count is None:
31 self._after_cleanup_count = self._max_cache * 8 / 1031 self._after_cleanup_count = self._max_cache * 8 // 10
32 else:32 else:
33 self._after_cleanup_count = min(after_cleanup_count,33 self._after_cleanup_count = min(after_cleanup_count,
34 self._max_cache)34 self._max_cache)
@@ -123,7 +123,7 @@
123 """123 """
124 self._max_cache = max_cache124 self._max_cache = max_cache
125 if after_cleanup_count is None:125 if after_cleanup_count is None:
126 self._after_cleanup_count = max_cache * 8 / 10126 self._after_cleanup_count = max_cache * 8 // 10
127 else:127 else:
128 self._after_cleanup_count = min(max_cache, after_cleanup_count)128 self._after_cleanup_count = min(max_cache, after_cleanup_count)
129 if len(self) > self._max_cache:129 if len(self) > self._max_cache:
@@ -193,7 +193,7 @@
193 FIFOCache.__init__(self, max_cache=max_size)193 FIFOCache.__init__(self, max_cache=max_size)
194 self._max_size = max_size194 self._max_size = max_size
195 if after_cleanup_size is None:195 if after_cleanup_size is None:
196 self._after_cleanup_size = self._max_size * 8 / 10196 self._after_cleanup_size = self._max_size * 8 // 10
197 else:197 else:
198 self._after_cleanup_size = min(after_cleanup_size, self._max_size)198 self._after_cleanup_size = min(after_cleanup_size, self._max_size)
199199
@@ -262,7 +262,7 @@
262 FIFOCache.resize(self, max_size)262 FIFOCache.resize(self, max_size)
263 self._max_size = max_size263 self._max_size = max_size
264 if after_cleanup_size is None:264 if after_cleanup_size is None:
265 self._after_cleanup_size = max_size * 8 / 10265 self._after_cleanup_size = max_size * 8 // 10
266 else:266 else:
267 self._after_cleanup_size = min(max_size, after_cleanup_size)267 self._after_cleanup_size = min(max_size, after_cleanup_size)
268 if self._value_size > self._max_size:268 if self._value_size > self._max_size:

Subscribers

People subscribed via source and target branches