mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Owner: Fix @upkeep reply on recent Pypy versions.
Because their gc.collect() function returns None.
This commit is contained in:
parent
10ccfbbf3c
commit
9e58b2c936
@ -411,8 +411,14 @@ class Owner(callbacks.Plugin):
|
|||||||
collected = world.upkeep()
|
collected = world.upkeep()
|
||||||
if gc.garbage:
|
if gc.garbage:
|
||||||
L.append('Garbage! %r.' % gc.garbage)
|
L.append('Garbage! %r.' % gc.garbage)
|
||||||
L.append(format('%n collected.', (collected, 'object')))
|
if collected is not None:
|
||||||
irc.reply(' '.join(L))
|
# Some time between 5.2 and 7.1, Pypy (3?) started returning None
|
||||||
|
# when gc.collect() is called.
|
||||||
|
L.append(format('%n collected.', (collected, 'object')))
|
||||||
|
if L:
|
||||||
|
irc.reply(' '.join(L))
|
||||||
|
else:
|
||||||
|
irc.replySuccess()
|
||||||
upkeep = wrap(upkeep, [additional(('literal', ['high']))])
|
upkeep = wrap(upkeep, [additional(('literal', ['high']))])
|
||||||
|
|
||||||
def load(self, irc, msg, args, optlist, name):
|
def load(self, irc, msg, args, optlist, name):
|
||||||
|
Loading…
Reference in New Issue
Block a user