Fix reading core nodes file while in different cwd

This commit is contained in:
TheKysek 2016-06-30 10:29:52 +02:00
parent 61c8e0d024
commit 3adb0ecf80

View File

@ -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)