This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The following script fixes `super()` calls after migration from Python 2 to Python 3. | |
The script edits the code automatically. Upon completion, the following steps are recommended: | |
- Search for the regex `super\([^\)]` and fix manually those places (if needed) | |
- Search for the regex `super\(\s[^\)]` and fix manually those places (if needed) | |
- Run Flake8 and manually fix styling problems | |
""" | |
import ast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import transaction | |
t = transaction.atomic() | |
t.__enter__() | |
# Do your stuff here... | |
pass | |
# If you want to *rollback* you changes: | |
t.__exit__('temp', 'temp', 'temp') |