mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
python3: do not use types.*Type which is an alias for str
Just compare to (str, unicode_type) directly, and handle the related python3 reclassification.
This commit is contained in:
parent
24f504f16b
commit
a75b0730a7
@ -7,7 +7,6 @@ __docformat__ = 'restructuredtext en'
|
|||||||
|
|
||||||
import re, codecs, os, numbers
|
import re, codecs, os, numbers
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from types import StringType, UnicodeType
|
|
||||||
|
|
||||||
from calibre import (strftime)
|
from calibre import (strftime)
|
||||||
from calibre.customize import CatalogPlugin
|
from calibre.customize import CatalogPlugin
|
||||||
@ -15,7 +14,7 @@ from calibre.library.catalogs import FIELDS, TEMPLATE_ALLOWED_FIELDS
|
|||||||
from calibre.customize.conversion import DummyReporter
|
from calibre.customize.conversion import DummyReporter
|
||||||
from calibre.constants import preferred_encoding
|
from calibre.constants import preferred_encoding
|
||||||
from calibre.ebooks.metadata import format_isbn
|
from calibre.ebooks.metadata import format_isbn
|
||||||
from polyglot.builtins import string_or_bytes
|
from polyglot.builtins import string_or_bytes, unicode_type
|
||||||
|
|
||||||
|
|
||||||
class BIBTEX(CatalogPlugin):
|
class BIBTEX(CatalogPlugin):
|
||||||
@ -351,7 +350,7 @@ class BIBTEX(CatalogPlugin):
|
|||||||
bibtexc.ascii_bibtex = True
|
bibtexc.ascii_bibtex = True
|
||||||
|
|
||||||
# Check citation choice and go to default in case of bad CLI
|
# Check citation choice and go to default in case of bad CLI
|
||||||
if isinstance(opts.impcit, (StringType, UnicodeType)) :
|
if isinstance(opts.impcit, (str, unicode_type)) :
|
||||||
if opts.impcit == 'False' :
|
if opts.impcit == 'False' :
|
||||||
citation_bibtex= False
|
citation_bibtex= False
|
||||||
elif opts.impcit == 'True' :
|
elif opts.impcit == 'True' :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user