latest version of black doesn't support py27

This commit is contained in:
bhaveshvasnani 2022-03-31 15:07:03 +05:30
parent fce2471d9e
commit 54e524cf39
3 changed files with 11 additions and 12 deletions

View File

@ -1462,16 +1462,12 @@ class Beautifier:
elif self._flags.last_token.type == TOKEN.OPERATOR:
# a++ + ++b
# a - -b
space_before = (
current_token.text
in [
"--",
"-",
"++",
"+",
]
and self._flags.last_token.text in ["--", "-", "++", "+"]
)
space_before = current_token.text in [
"--",
"-",
"++",
"+",
] and self._flags.last_token.text in ["--", "-", "++", "+"]
# + and - are not unary when preceeded by -- or ++ operator
# a-- + b
# a * +b
@ -1591,6 +1587,9 @@ class Beautifier:
else:
self.handle_whitespace_and_comments(current_token, True)
if re.search(self._flags.last_token.text, "^[0-9]+$"):
self._flags.whitespace_before = True
if reserved_array(self._flags.last_token, _special_word_set):
self._output.space_before_token = False
else:

View File

@ -157,5 +157,5 @@ class Unbaser(object):
"""Decodes a value to an integer."""
ret = 0
for index, cipher in enumerate(string[::-1]):
ret += (self.base ** index) * self.dictionary[cipher]
ret += (self.base**index) * self.dictionary[cipher]
return ret

View File

@ -1,5 +1,5 @@
[tool.black]
target-version = ['py27', 'py36', 'py37', 'py38']
target-version = ['py36', 'py37', 'py38']
exclude = '''
/(
\.eggs