py3: Replace useage of im_func

This commit is contained in:
Kovid Goyal 2019-04-23 10:46:58 +05:30
parent f4cf168a72
commit a6eb1d79ea
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 2 deletions

View File

@ -212,7 +212,7 @@ class Device(DeviceConfig, DevicePlugin):
def can_handle_windows(self, usbdevice, debug=False):
from calibre.devices.interface import DevicePlugin
if self.can_handle.im_func is DevicePlugin.can_handle.im_func:
if self.can_handle.__func__ is DevicePlugin.can_handle.__func__:
# No custom can_handle implementation
return True
# Delegate to the unix can_handle function, creating a unix like

View File

@ -982,6 +982,7 @@ class BasicNewsRecipe(Recipe):
script.extract()
for attr in self.remove_attributes:
for x in soup.findAll(attrs={attr:True}):
print(1111111111, x)
del x[attr]
for base in list(soup.findAll(['base', 'iframe', 'canvas', 'embed',
'command', 'datalist', 'video', 'audio'])):
@ -1117,7 +1118,7 @@ class BasicNewsRecipe(Recipe):
def _fetch_article(self, url, dir_, f, a, num_of_feeds):
br = self.browser
if self.get_browser.im_func is BasicNewsRecipe.get_browser.im_func:
if self.get_browser.__func__ is BasicNewsRecipe.get_browser.__func__:
# We are using the default get_browser, which means no need to
# clone
br = BasicNewsRecipe.get_browser(self)