mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Fixed escaping IOError from add command.
This commit is contained in:
parent
909597b7ac
commit
c17f85e51b
@ -130,8 +130,8 @@ class Lookup(callbacks.Privmsg):
|
||||
try:
|
||||
filename = os.path.join(conf.dataDir, filename)
|
||||
fd = file(filename)
|
||||
except OSError, e:
|
||||
irc.error('Could open %s: %s' % (filename, e))
|
||||
except EnvironmentError, e:
|
||||
irc.error('Could not open %s: %s' % (filename, e))
|
||||
return
|
||||
cursor.execute("""CREATE TABLE %s (key TEXT, value TEXT)""" % name)
|
||||
sql = """INSERT INTO %s VALUES (%%s, %%s)""" % name
|
||||
|
@ -33,6 +33,11 @@ from test import *
|
||||
|
||||
import os
|
||||
|
||||
try:
|
||||
import sqlite
|
||||
except ImportError:
|
||||
sqlite = None
|
||||
|
||||
import conf
|
||||
|
||||
class LookupTestCase(PluginTestCase, PluginDocumentation):
|
||||
@ -65,6 +70,9 @@ class LookupTestCase(PluginTestCase, PluginDocumentation):
|
||||
finally:
|
||||
conf.replyWhenNotCommand = original
|
||||
|
||||
def testNotEscapingIOError(self):
|
||||
self.assertNotRegexp('lookup add foo asdlfkjsdalfkj', 'IOError')
|
||||
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||
|
Loading…
Reference in New Issue
Block a user