Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#application: bash-minifier
#version: 1
runtime: python27
runtime: python3
api_version: 1
threadsafe: true

Expand Down
5 changes: 2 additions & 3 deletions minifier.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3

import sys

Expand All @@ -19,7 +19,7 @@ def is_group_opening(self):
def __eq__(self, other):
if isinstance(other, BashFileIterator._Delimiter):
return other.character == self.character
elif isinstance(other, basestring):
elif isinstance(other, str):
return other == self.character
return False

Expand Down Expand Up @@ -213,7 +213,6 @@ def close_heredoc():
self.pos += 1

assert not self.isInsideGroup(), 'Invalid syntax'
raise StopIteration

def isEscaped(self):
return self.pos in self._indices_of_escaped_characters
Expand Down
4 changes: 2 additions & 2 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ passed=0
failed=0
for f in t*.sh; do
echo -n "$f "
python ../minifier.py $f > _tmp_$f
python3 ../minifier.py $f > _tmp_$f
if [ `diff _tmp_$f minified_$f | wc -c` -ne 0 ]; then
failed=$((failed+1))
echo FAILED
Expand All @@ -16,4 +16,4 @@ for f in t*.sh; do
rm _tmp_$f
done
echo PASSED $passed, FAILED $failed
popd > /dev/null
popd > /dev/null