File tree Expand file tree Collapse file tree 4 files changed +10
-1
lines changed Expand file tree Collapse file tree 4 files changed +10
-1
lines changed Original file line number Diff line number Diff line change
1
+ from __future__ import absolute_import
2
+
1
3
from py3nvml import py3nvml
2
4
from py3nvml import nvidia_smi
3
5
from py3nvml .utils import grab_gpus
Original file line number Diff line number Diff line change @@ -381,7 +381,10 @@ class struct_c_nvmlUnit_t(Structure):
381
381
# Convert bytes objects to strings or leave untouched
382
382
def bytes_to_str (s ):
383
383
if type (s ) is bytes :
384
- return str (s , 'utf-8' )
384
+ try :
385
+ return str (s , 'utf-8' )
386
+ except TypeError : # Can get this if running python 2
387
+ return str (s )
385
388
else :
386
389
return s
387
390
Original file line number Diff line number Diff line change 1
1
from __future__ import absolute_import
2
2
from __future__ import print_function
3
+ from __future__ import division
3
4
4
5
import logging
5
6
import os
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env python
2
+ from __future__ import print_function
3
+ from __future__ import division
4
+ from __future__ import absolute_import
2
5
3
6
from py3nvml .py3nvml import *
4
7
from datetime import datetime
You can’t perform that action at this time.
0 commit comments