You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
If a file contains a doc-string that requires formatting, and the exec statement, Black will complain that the change to the doc-string is not equivalent.
Note that this only applies to the exec statement. The exec() function works as expected. Therefore this issue only applies if the target Python version is 2.7.
To Reproduce
Using a file with the following contents
def Foo():
"""
"""
exec ""
Run Black on it with these arguments --target-version=py27
See error
Expected behavior
Black would format the file, including the doc-string, without an error stating that the code is not equivalent.
Additional context
The same issue exists when Black reformats a doc-string with an Exception handler that uses the "comma" syntax to get the instance of the exception. i.e. except Exception, e:
See here for a snippet in the Black playground.
The text was updated successfully, but these errors were encountered:
Description
If a file contains a doc-string that requires formatting, and the
exec
statement, Black will complain that the change to the doc-string is not equivalent.Note that this only applies to the
exec
statement. Theexec()
function works as expected. Therefore this issue only applies if the target Python version is 2.7.To Reproduce
--target-version=py27
Expected behavior
Black would format the file, including the doc-string, without an error stating that the code is not equivalent.
Environment
Does this bug also happen on master?
Yes
Additional context
The same issue exists when Black reformats a doc-string with an Exception handler that uses the "comma" syntax to get the instance of the exception. i.e.
except Exception, e:
See here for a snippet in the Black playground.
The text was updated successfully, but these errors were encountered: