Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit 832cb4f

Browse files
BartoszCkidandruszak
authored andcommitted
Fix-converting-to-byte
1 parent 098e871 commit 832cb4f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,5 @@ ENV/
102102

103103
#vscode
104104
.vscode/*
105+
106+
.idea

paperspace/jobs.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
import base64
22
import inspect
3-
import json
4-
import os
53
import re
6-
import sys
7-
import time
84

95
import boto3
106
import botocore
11-
import requests
7+
import six
128

13-
from . import config
149
from .login import apikey
1510
from .method import *
1611

12+
1713
def list(params={}):
1814
return method('jobs', 'getJobs', params)
1915

@@ -415,13 +411,15 @@ def run(params={}, no_logging=False):
415411
print(params['command'])
416412
sys.exit(1)
417413

418-
params['command'] = base64.b64encode(bytes(params['command'], 'utf-8'))
414+
if six.PY3:
415+
params['command'] = bytes(params['command'], 'utf-8')
416+
417+
params['command'] = base64.b64encode(params['command'])
419418
res = create(params, no_logging)
420419
if run_this:
421420
sys.exit(0)
422421
return res
423422

424-
425423
# TO DO:
426424
# automatic install of imported dependencies
427425
# allow return results

0 commit comments

Comments
 (0)