]> git.phdru.name Git - m_librarian.git/blobdiff - m_librarian/db.py
Fix flake8 E305: expected 2 blank lines after function
[m_librarian.git] / m_librarian / db.py
index ecabfdbcfd146cf583ea2d8aa6dcfe1e1a7d1be0..628675ef1e2c9d3ce4573ba1240b542784d5e499 100755 (executable)
@@ -5,6 +5,7 @@ import os
 from sqlobject import SQLObject, StringCol, UnicodeCol, IntCol, BoolCol, \
     ForeignKey, DateCol, DatabaseIndex, RelatedJoin, \
     connectionForURI, sqlhub, SQLObjectNotFound, dberrors
+from .compat import string_type
 from .config import get_config
 
 __all__ = ['Author', 'Book', 'Extension', 'Genre', 'Language',
@@ -156,7 +157,7 @@ def open_db(db_uri=None):
 
     if connection.dbName == 'sqlite':
         def lower(s):
-            if isinstance(s, basestring):
+            if isinstance(s, string_type):
                 return s.lower()
             return s
 
@@ -224,5 +225,6 @@ def test():
     print("DB dirs:", db_dirs)
     print("DB URI:", find_sqlite_dburi())
 
+
 if __name__ == '__main__':
     test()