mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Add pyupgrade to pre-commit configuration (#1783)
To help us switch to f-strings and other 3.6+ changes, add pyupgrade to our pre-commit configuration to keep the codebase clean.
This commit is contained in:
+6
-11
@@ -1,5 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
############################ Copyrights and license ############################
|
||||
# #
|
||||
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
|
||||
@@ -66,7 +64,7 @@ class _BadAttribute:
|
||||
)
|
||||
|
||||
|
||||
class GithubObject(object):
|
||||
class GithubObject:
|
||||
"""
|
||||
Base class for all classes representing objects returned by the API.
|
||||
"""
|
||||
@@ -233,13 +231,10 @@ class GithubObject(object):
|
||||
for key, element in value.items()
|
||||
):
|
||||
return _ValuedAttribute(
|
||||
dict(
|
||||
(
|
||||
key,
|
||||
klass(self._requester, self._headers, element, completed=False),
|
||||
)
|
||||
{
|
||||
key: klass(self._requester, self._headers, element, completed=False)
|
||||
for key, element in value.items()
|
||||
)
|
||||
}
|
||||
)
|
||||
else:
|
||||
return _BadAttribute(value, {str: dict})
|
||||
@@ -269,8 +264,8 @@ class GithubObject(object):
|
||||
if isinstance(v, bytes):
|
||||
v = v.decode("utf-8")
|
||||
if isinstance(v, str):
|
||||
v = '"{v}"'.format(v=v)
|
||||
yield u"{k}={v}".format(k=k, v=v)
|
||||
v = f'"{v}"'
|
||||
yield f"{k}={v}"
|
||||
|
||||
return "{class_name}({params})".format(
|
||||
class_name=self.__class__.__name__,
|
||||
|
||||
Reference in New Issue
Block a user