Skip to content

Commit

Permalink
pickle isnt needed thats py2
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeftor committed Apr 5, 2022
1 parent 611d12b commit 8ed832f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
7 changes: 1 addition & 6 deletions workflow/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@


import os

try:
import cPickle as pickle
except:
import pickle

import pickle
import signal
import subprocess
import sys
Expand Down
13 changes: 7 additions & 6 deletions workflow/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@
import logging
import logging.handlers
import os

try:
import cPickle as pickle
except:
import pickle

import pickle
import plistlib
import re
import shutil
Expand Down Expand Up @@ -1605,6 +1600,8 @@ def stored_data(self, name):
"to load this data.".format(serializer_name)
)

self.logger.debug("data `%s` stored as `%s`", name, serializer_name)

filename = "{0}.{1}".format(name, serializer_name)
data_path = self.datafile(filename)

Expand All @@ -1618,6 +1615,8 @@ def stored_data(self, name):
with open(data_path, "rb") as file_obj:
data = serializer.load(file_obj)

self.logger.debug("stored data loaded: %s", data_path)

return data

def store_data(self, name, data, serializer=None):
Expand Down Expand Up @@ -1687,6 +1686,8 @@ def _store():

_store()

self.logger.debug("saved data: %s", data_path)

def cached_data(self, name, data_func=None, max_age=60):
"""Return cached data if younger than ``max_age`` seconds.
Expand Down

0 comments on commit 8ed832f

Please sign in to comment.