summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2015-07-26 10:51:01 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2015-07-26 10:51:01 +0200
commitc66fbacf8b3095c6de264657362e403920edace2 (patch)
tree562182cf20b6d8937f61fcd181be9866988f4e8f
parent621e1d84607a158491ce80c47814e51a8c366498 (diff)
downloadsqlparse-c66fbacf8b3095c6de264657362e403920edace2.tar.gz
Don't add duplicate "\n" when using sqlformat tool (fixes #191).
-rw-r--r--CHANGES1
-rwxr-xr-xbin/sqlformat2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 9e0b44b..859fce8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,7 @@ Development version
Bug Fixes
* Fix a regression in get_alias() introduced in 0.1.15 (issue185).
* Fix a bug in the splitter regarding DECLARE (issue193).
+* sqlformat command line tool doesn't duplicat newlines anymore (issue191).
Release 0.1.15 (Apr 15, 2015)
diff --git a/bin/sqlformat b/bin/sqlformat
index fcee452..cecbed9 100755
--- a/bin/sqlformat
+++ b/bin/sqlformat
@@ -77,7 +77,7 @@ def main():
data = sys.stdin.read()
else:
try:
- data = '\n'.join(open(args[0]).readlines())
+ data = ''.join(open(args[0]).readlines())
except OSError:
err = sys.exc_info()[1] # Python 2.5 compatibility
_error('Failed to read %s: %s' % (args[0], err), exit_=1)