From 740d4815fda8737cc7f021999d30aeacd851b032 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 29 Dec 2017 07:40:20 +0100 Subject: DPDCE: fix Adapt init and pickle usage --- dpd/src/Adapt.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dpd/src') diff --git a/dpd/src/Adapt.py b/dpd/src/Adapt.py index c78c920..939e50e 100644 --- a/dpd/src/Adapt.py +++ b/dpd/src/Adapt.py @@ -239,20 +239,20 @@ class Adapt: "digital_gain": self.get_digital_gain(), "predistorter": self.get_predistorter() } - with open(path, "w") as f: + with open(path, "wb") as f: pickle.dump(d, f) return path def load(self, path): """Restore settings from a file""" - with open(path, "r") as f: + with open(path, "rb") as f: d = pickle.load(f) - self.set_txgain(d["txgain"]) - self.set_digital_gain(d["digital_gain"]) - self.set_rxgain(d["rxgain"]) - self.set_predistorter(d["predistorter"]) + self.set_txgain(d["txgain"]) + self.set_digital_gain(d["digital_gain"]) + self.set_rxgain(d["rxgain"]) + self.set_predistorter(d["predistorter"]) # The MIT License (MIT) # -- cgit v1.2.3