From 0b973057d0be4bddae7cdaec9ef225743d9fa94b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 24 Oct 2020 13:24:46 +0530 Subject: [PATCH] Fix #1901289 [Cannot communicate with Sony PRS 650](https://bugs.launchpad.net/calibre/+bug/1901289) --- src/calibre/devices/usbms/books.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/devices/usbms/books.py b/src/calibre/devices/usbms/books.py index 4f530f38cf..507ee5ff91 100644 --- a/src/calibre/devices/usbms/books.py +++ b/src/calibre/devices/usbms/books.py @@ -24,7 +24,10 @@ def none_cmp(xx, yy): y = yy[1] if x is None and y is None: # No sort_key needed here, because defaults are ascii - return cmp(xx[2], yy[2]) + try: + return cmp(xx[2], yy[2]) + except TypeError: + return 0 if x is None: return 1 if y is None: