hgext/convert/darcs.py
changeset 48934 06de08b36c82
parent 48875 6000f5b25c9b
child 49306 2e726c934fcd
equal deleted inserted replaced
48933:78f1de3f4be7 48934:06de08b36c82
   111     def after(self):
   111     def after(self):
   112         self.ui.debug(b'cleaning up %s\n' % self.tmppath)
   112         self.ui.debug(b'cleaning up %s\n' % self.tmppath)
   113         shutil.rmtree(self.tmppath, ignore_errors=True)
   113         shutil.rmtree(self.tmppath, ignore_errors=True)
   114 
   114 
   115     def recode(self, s, encoding=None):
   115     def recode(self, s, encoding=None):
   116         if isinstance(s, pycompat.unicode):
   116         if isinstance(s, str):
   117             # XMLParser returns unicode objects for anything it can't
   117             # XMLParser returns unicode objects for anything it can't
   118             # encode into ASCII. We convert them back to str to get
   118             # encode into ASCII. We convert them back to str to get
   119             # recode's normal conversion behavior.
   119             # recode's normal conversion behavior.
   120             s = s.encode('latin-1')
   120             s = s.encode('latin-1')
   121         return super(darcs_source, self).recode(s, encoding)
   121         return super(darcs_source, self).recode(s, encoding)