Fix issue_703: backward compatibility with python3.6 (#715)

This commit is contained in:
Alexey U. Gudchenko 2020-01-20 22:50:57 +03:00 committed by William Falcon
parent ea59a99426
commit 06242c200a
1 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import gc
import logging
import os
import subprocess
from subprocess import PIPE
import numpy as np
import pandas as pd
@ -235,7 +236,8 @@ def get_gpu_memory_map():
'--format=csv,nounits,noheader',
],
encoding='utf-8',
capture_output=True,
# capture_output=True, # valid for python version >=3.7
stdout=PIPE, stderr=PIPE, # for backward compatibility with python version 3.6
check=True)
# Convert lines into a dictionary
gpu_memory = [int(x) for x in result.stdout.strip().split(os.linesep)]