mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 20:52:42 +01:00
Made the reload and load commands also update linecache, so tracebacks are correctly line-numbered and whatnot.
This commit is contained in:
parent
ebd2113eb3
commit
c4005a115a
@ -34,6 +34,7 @@ from fix import *
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import imp
|
import imp
|
||||||
|
import linecache
|
||||||
|
|
||||||
import conf
|
import conf
|
||||||
import debug
|
import debug
|
||||||
@ -254,6 +255,7 @@ class OwnerCommands(CapabilityCheckingPrivmsg):
|
|||||||
irc.error(msg, 'No plugin %s exists.' % name)
|
irc.error(msg, 'No plugin %s exists.' % name)
|
||||||
return
|
return
|
||||||
module = imp.load_module(name, *moduleInfo)
|
module = imp.load_module(name, *moduleInfo)
|
||||||
|
linecache.checkcache()
|
||||||
callback = module.Class()
|
callback = module.Class()
|
||||||
irc.addCallback(callback)
|
irc.addCallback(callback)
|
||||||
irc.reply(msg, conf.replySuccess)
|
irc.reply(msg, conf.replySuccess)
|
||||||
@ -284,6 +286,7 @@ class OwnerCommands(CapabilityCheckingPrivmsg):
|
|||||||
try:
|
try:
|
||||||
moduleInfo = imp.find_module(name)
|
moduleInfo = imp.find_module(name)
|
||||||
module = imp.load_module(name, *moduleInfo)
|
module = imp.load_module(name, *moduleInfo)
|
||||||
|
linecache.checkcache()
|
||||||
callback = module.Class()
|
callback = module.Class()
|
||||||
irc.addCallback(callback)
|
irc.addCallback(callback)
|
||||||
irc.reply(msg, conf.replySuccess)
|
irc.reply(msg, conf.replySuccess)
|
||||||
|
Loading…
Reference in New Issue
Block a user