diff mercurial/vfs.py @ 31644:f80d9ddc40f3

py3: abuse r'' to preserve str-ness of literals passed to __setattr__()
author Yuya Nishihara <yuya@tcha.org>
date Sun, 26 Mar 2017 16:33:12 +0900
parents 18b9d9b95719
children d74b0cff94a9 20bac46f7744
line wrap: on
line diff
--- a/mercurial/vfs.py	Sun Mar 26 17:12:06 2017 +0900
+++ b/mercurial/vfs.py	Sun Mar 26 16:33:12 2017 +0900
@@ -480,7 +480,7 @@
     Do not instantiate outside of the vfs layer.
     """
     def __init__(self, fh):
-        object.__setattr__(self, '_origfh', fh)
+        object.__setattr__(self, r'_origfh', fh)
 
     def __getattr__(self, attr):
         return getattr(self._origfh, attr)
@@ -507,7 +507,7 @@
     """
     def __init__(self, fh, closer):
         super(delayclosedfile, self).__init__(fh)
-        object.__setattr__(self, '_closer', closer)
+        object.__setattr__(self, r'_closer', closer)
 
     def __exit__(self, exc_type, exc_value, exc_tb):
         self._closer.close(self._origfh)
@@ -618,7 +618,7 @@
     """
     def __init__(self, fh):
         super(checkambigatclosing, self).__init__(fh)
-        object.__setattr__(self, '_oldstat', util.filestat(fh.name))
+        object.__setattr__(self, r'_oldstat', util.filestat(fh.name))
 
     def _checkambig(self):
         oldstat = self._oldstat