From 285b4434b7ec2c562459e9ad61ee390e7e0610e1 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 4 Jun 2018 01:39:39 -0400 Subject: [PATCH] Suppressing the output is useless (fucking C function...) --- pvcf.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pvcf.py b/pvcf.py index 1acb8679..0de8231d 100644 --- a/pvcf.py +++ b/pvcf.py @@ -9,8 +9,7 @@ import os, sys, libvirt, uuid # > lookupByUUID # This function is a wrapper for libvirt.lookupByUUID which fixes some problems # 1. Takes a text UUID and handles converting it to bytes -# 2. Disables stdout to avoid stupid printouts -# 3. Try's it and returns a sensible value if not +# 2. Try's it and returns a sensible value if not def lookupByUUID(tuuid): conn = None dom = None @@ -19,12 +18,6 @@ def lookupByUUID(tuuid): # Convert the text UUID to bytes buuid = uuid.UUID(tuuid).bytes - # Flush and disable stdout and stderr - sys.stdout.flush() - sys.stderr.flush() - sys.stdout = open(os.devnull, 'w') - sys.stderr = open(os.devnull, 'w') - # Try try: # Open a libvirt connection @@ -46,12 +39,6 @@ def lookupByUUID(tuuid): if conn != None: conn.close() - # Flush and enable stdout and stderr - sys.stdout.flush() - sys.stderr.flush() - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - # Return the dom object (or None) return dom