Use a context manager to write to /dev/null
This commit is contained in:
1 parent
e8f83708b0
commit
cb8492d8a7
1 file changed
+1
-1
@@ -302,8 +302,8 @@ class MigrationLinter:
|
|||||||
|
|
||||||
def get_sql(self, app_label, migration_name):
|
def get_sql(self, app_label, migration_name):
|
||||||
logger.info(f"Calling sqlmigrate command {app_label} {migration_name}")
|
logger.info(f"Calling sqlmigrate command {app_label} {migration_name}")
|
||||||
dev_null = open(os.devnull, "w")
|
|
||||||
try:
|
try:
|
||||||
|
with open(os.devnull, "w") as dev_null:
|
||||||
sql_statement = call_command(
|
sql_statement = call_command(
|
||||||
"sqlmigrate",
|
"sqlmigrate",
|
||||||
app_label,
|
app_label,
|
||||||
|
|||||||
Reference in new issue
Block a user