Skip to content

Raise with string and format operator is fixed incorrectly #192

Open
@dwvisser

Description

@dwvisser

This is similar to issue #180, which appears to have been closed without any justification given. Here's the relevant portion of the output of python-modernize (v0.7) which illustrates the bug:

--- test_modernize_formatted_raise.py	(original)
+++ test_modernize_formatted_raise.py	(refactored)
@@ -1,4 +1,4 @@
 def hello(name, language):
     if language is None:
-        raise('Language for %s not defined' % name)
+        raise 'Language for %s not defined'
     pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions