From 9671f1ff5445de0a394d485639fd92556634df27 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 6 Mar 2009 08:24:33 -0800 Subject: [PATCH] Fix #1995 (TypeError: Argument must be string or unicode.) --- src/calibre/ebooks/mobi/mobiml.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/calibre/ebooks/mobi/mobiml.py b/src/calibre/ebooks/mobi/mobiml.py index 7ecd127452..8dca993a64 100644 --- a/src/calibre/ebooks/mobi/mobiml.py +++ b/src/calibre/ebooks/mobi/mobiml.py @@ -6,8 +6,6 @@ from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Marshall T. Vandegrift ' -import sys -import os import copy import re from lxml import etree @@ -187,7 +185,7 @@ class MobiMLizer(object): while vspace > 0: wrapper.addprevious(etree.Element(XHTML('br'))) vspace -= 1 - if istate.halign != 'auto': + if istate.halign != 'auto' and isinstance(istate.halign, (str, unicode)): para.attrib['align'] = istate.halign pstate = bstate.istate if tag in CONTENT_TAGS: