diff options
| author | Claude Paroz <claude@2xlibre.net> | 2018-07-20 00:05:33 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-07-19 18:05:33 -0400 |
| commit | 65503ca09798bffbe8226c3a8a7953906042b2ee (patch) | |
| tree | f85c9f0b173b313d7ca4c7007e0daaf4ebed25bd /django/db/backends/postgresql/creation.py | |
| parent | 1e9b02a4c28142303fb4d33632e77ff7e26acb8b (diff) | |
Fixed #29040 -- Made test database creation messages use a consistent output stream.
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) |
