diff options
Diffstat (limited to 'django/db/backends/postgresql/creation.py')
| -rw-r--r-- | django/db/backends/postgresql/creation.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/db/backends/postgresql/creation.py b/django/db/backends/postgresql/creation.py index 0169fc5c1f..8b6c4eff19 100644 --- a/django/db/backends/postgresql/creation.py +++ b/django/db/backends/postgresql/creation.py @@ -34,7 +34,7 @@ class DatabaseCreation(BaseDatabaseCreation): except Exception as e: if getattr(e.__cause__, 'pgcode', '') != errorcodes.DUPLICATE_DATABASE: # All errors except "database already exists" cancel tests. - sys.stderr.write('Got an error creating the test database: %s\n' % e) + self.log('Got an error creating the test database: %s' % e) sys.exit(2) elif not keepdb: # If the database should be kept, ignore "database already @@ -58,11 +58,11 @@ class DatabaseCreation(BaseDatabaseCreation): except Exception as e: try: if verbosity >= 1: - print("Destroying old test database for alias %s..." % ( + self.log('Destroying old test database for alias %s...' % ( self._get_database_display_str(verbosity, target_database_name), )) cursor.execute('DROP DATABASE %(dbname)s' % test_db_params) self._execute_create_test_db(cursor, test_db_params, keepdb) except Exception as e: - sys.stderr.write("Got an error cloning the test database: %s\n" % e) + self.log('Got an error cloning the test database: %s' % e) sys.exit(2) |
