From cf8f6b558427df64f9b9516c0547a7acc29871f6 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Wed, 23 Oct 2013 00:36:49 -0700 Subject: [PATCH] Make no assumptions about the stream. --- 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 7b25426..482c1e4 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() - if not stream.seekable() or stream.tell() > 0: - stream.write('\n') - + stream.write('\n') stream.write(text) stream.write(';')