From 3adb0ecf80ac62f051dac2730c93114412f9bf18 Mon Sep 17 00:00:00 2001 From: TheKysek Date: Thu, 30 Jun 2016 10:29:52 +0200 Subject: [PATCH] Fix reading core nodes file while in different cwd --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 50547e4..0f5a7d8 100644 --- a/src/main.py +++ b/src/main.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import csv import logging +import os import pickle import socket @@ -27,7 +28,7 @@ def main(): logging.warning('Error while loading nodes from disk.') logging.warning(e) - with open('core_nodes.csv', mode='r', newline='') as f: + with open(os.path.dirname(os.path.realpath(__file__)) + '/core_nodes.csv', mode='r', newline='') as f: reader = csv.reader(f) shared.core_nodes = {tuple(row) for row in reader} shared.node_pool.update(shared.core_nodes)