mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
Apply pyupgrade changes
This commit is contained in:
@@ -197,7 +197,7 @@ class File:
|
||||
self.path = path
|
||||
|
||||
def __repr__(self):
|
||||
return "<{} {}>".format(self.__class__.__name__, str(self.path))
|
||||
return f"<{self.__class__.__name__} {str(self.path)}>"
|
||||
|
||||
def __getattribute__(self, attrname):
|
||||
result = object.__getattribute__(self, attrname)
|
||||
@@ -317,7 +317,7 @@ class File:
|
||||
raise AlreadyExistsError(newname, self.path.parent)
|
||||
try:
|
||||
self.path.rename(destpath)
|
||||
except EnvironmentError:
|
||||
except OSError:
|
||||
raise OperationError(self)
|
||||
if not destpath.exists():
|
||||
raise OperationError(self)
|
||||
@@ -421,5 +421,5 @@ def get_files(path, fileclasses=[File]):
|
||||
if file is not None:
|
||||
result.append(file)
|
||||
return result
|
||||
except EnvironmentError:
|
||||
except OSError:
|
||||
raise InvalidPath(path)
|
||||
|
||||
Reference in New Issue
Block a user