From 8080e766500469a4b8b8e7342d9a50e162744780 Mon Sep 17 00:00:00 2001 From: "kuldeep.k@cisinlabs.com" Date: Tue, 10 Aug 2021 21:01:03 +0530 Subject: [PATCH] Updated code quality for bitmessagemain.py --- src/bitmessagemain.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index e04e3187..aa1cda1b 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -12,15 +12,6 @@ The PyBitmessage startup script import os import sys -try: - import pathmagic -except ImportError: - from pybitmessage import pathmagic -app_dir = pathmagic.setup() - -import depends -depends.check_dependencies() - import ctypes import getopt import multiprocessing @@ -53,6 +44,15 @@ from threads import ( set_thread_name, printLock, addressGenerator, objectProcessor, singleCleaner, singleWorker, sqlThread) +import depends +depends.check_dependencies() + +try: + import pathmagic +except ImportError: + from pybitmessage import pathmagic +app_dir = pathmagic.setup() + def _fixSocket(): if sys.platform.startswith('linux'): @@ -424,9 +424,9 @@ class Main(object): sys.stdout.flush() sys.stderr.flush() if not sys.platform.startswith('win'): - si = file(os.devnull, 'r') - so = file(os.devnull, 'a+') - se = file(os.devnull, 'a+', 0) + si = open(os.devnull, 'r') + so = open(os.devnull, 'a+') + se = open(os.devnull, 'a+', 0) os.dup2(si.fileno(), sys.stdin.fileno()) os.dup2(so.fileno(), sys.stdout.fileno()) os.dup2(se.fileno(), sys.stderr.fileno())