mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #7821/92f8bf7b backport][stable-7] mssql_script: make module Python 2 compatible (#7865)
mssql_script: make module Python 2 compatible (#7821)
Make module Python 2 compatible.
(cherry picked from commit 92f8bf7b6f
)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
504759ce92
commit
8bc51bb0ec
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/7821-mssql_script-py2.yml
Normal file
2
changelogs/fragments/7821-mssql_script-py2.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "mssql_script - make the module work with Python 2 (https://github.com/ansible-collections/community.general/issues/7818, https://github.com/ansible-collections/community.general/pull/7821)."
|
|
@ -284,7 +284,7 @@ def run_module():
|
||||||
# Process the script into batches
|
# Process the script into batches
|
||||||
queries = []
|
queries = []
|
||||||
current_batch = []
|
current_batch = []
|
||||||
for statement in script.splitlines(keepends=True):
|
for statement in script.splitlines(True):
|
||||||
# Ignore the Byte Order Mark, if found
|
# Ignore the Byte Order Mark, if found
|
||||||
if statement.strip() == '\uFEFF':
|
if statement.strip() == '\uFEFF':
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue