mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-16 11:26:08 +00:00
Use stdin argument instead of input for subprocess; makes it python 3.2 compatible
This commit is contained in:
parent
a69fd10131
commit
dadd074ffd
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,3 +18,4 @@ profile/profile.tar
|
||||
cabal.sandbox.config
|
||||
.tmp1
|
||||
.tmp2
|
||||
.tmp3
|
||||
|
@ -8,8 +8,11 @@ import subprocess
|
||||
|
||||
|
||||
def hindent(contents):
|
||||
output = subprocess.check_output(["hindent", "--style", "gibiansky"],
|
||||
input=bytes(contents, 'utf-8'))
|
||||
with open(".tmp3", "w") as f:
|
||||
f.write(contents)
|
||||
with open(".tmp3", "r") as f:
|
||||
output = subprocess.check_output(["hindent", "--style", "gibiansky"],
|
||||
stdin=f)
|
||||
return output.decode('utf-8')
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user