From ce81037aeb1913e140b8e3b564c1f6eeac3cd350 Mon Sep 17 00:00:00 2001 From: Anatoli Fedynitch Date: Mon, 11 May 2020 23:07:40 +0900 Subject: [PATCH] Fixed GSF on python 2.7 --- crflux/models.py | 9 ++++++--- setup.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/crflux/models.py b/crflux/models.py index 3525dad..2531e6d 100644 --- a/crflux/models.py +++ b/crflux/models.py @@ -1064,9 +1064,12 @@ def __init__(self, spl_fname=None): if fdate(fn) >= fdate(spl_fname): spl_fname = fn spl_fname = os.path.join(base_path, spl_fname) - - self.p_frac_spl, self.p_flux_spl, self.n_flux_spl = pickle.load( - bz2.BZ2File(spl_fname), encoding='latin1') + try: + self.p_frac_spl, self.p_flux_spl, self.n_flux_spl = pickle.load( + bz2.BZ2File(spl_fname), encoding='latin1') + except TypeError: + self.p_frac_spl, self.p_flux_spl, self.n_flux_spl = pickle.load( + bz2.BZ2File(spl_fname)) self.nucleus_ids = [] diff --git a/setup.py b/setup.py index abc9f26..9a7703d 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from setuptools import setup -__version__ = "1.0.5" +__version__ = "1.0.6" def setup_package(): from os.path import abspath, dirname, join