From 7c7e84c8a91b382dd6d630620258bd47fd6141c8 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Wed, 23 Oct 2013 00:51:08 -0700 Subject: [PATCH] Write at once. --- sqlalchemy_utils/functions/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sqlalchemy_utils/functions/__init__.py b/sqlalchemy_utils/functions/__init__.py index 482c1e4..998dc7d 100644 --- a/sqlalchemy_utils/functions/__init__.py +++ b/sqlalchemy_utils/functions/__init__.py @@ -271,9 +271,7 @@ def create_mock_engine(bind, stream=None): text = re.sub(r'\n+', '\n', text) text = text.strip('\n').strip() - stream.write('\n') - stream.write(text) - stream.write(';') + stream.write('\n%s;' % text) else: