summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeLibertineGamer <zlg@zlg.space>2016-05-23 03:30:59 -0700
committerZe Libertine Gamer <zlg@zlg.space>2016-05-23 03:30:59 -0700
commit921b08eab3f4a4bcac33e4c5e90134d3b8cf0383 (patch)
treeb1ff5a73eca412dbc2ee69bfb0a20b781a19f800
parentInitial commit (diff)
downloadvgstash-921b08eab3f4a4bcac33e4c5e90134d3b8cf0383.tar.gz
vgstash-921b08eab3f4a4bcac33e4c5e90134d3b8cf0383.tar.bz2
vgstash-921b08eab3f4a4bcac33e4c5e90134d3b8cf0383.tar.xz
vgstash-921b08eab3f4a4bcac33e4c5e90134d3b8cf0383.zip
Correct uncaught BrokenPipeError
Even if you catch that exception, Python complains. This happens when piping to head or any other program that may exit before vgstash is done. The solution is to simply close stderr when you're done.
Diffstat (limited to '')
-rwxr-xr-xvgstash2
1 files changed, 2 insertions, 0 deletions
diff --git a/vgstash b/vgstash
index c1775d6..0983f1c 100755
--- a/vgstash
+++ b/vgstash
@@ -399,6 +399,8 @@ def main():
# Let'er rip!
args = parser.parse_args()
args.func(args)
+ # Oddity in Python needed if you're going to play nice with piping
+ sys.stderr.close()
# Our usual incantation
if __name__ == "__main__":