Fixed ModuleNotFoundError when running setup.py to load/dump servers. Fixes #7663

Patch Sent By: Karl Maximilian Daenner
This commit is contained in:
Akshay Joshi 2022-09-06 11:48:55 +05:30
parent 7c729d5f0e
commit 71c962f51c
2 changed files with 8 additions and 6 deletions

View File

@ -28,3 +28,4 @@ Bug fixes
| `Issue #7644 <https://redmine.postgresql.org/issues/7644>`_ - Ensure that the dump servers functionality works from setup.py.
| `Issue #7646 <https://redmine.postgresql.org/issues/7646>`_ - Ensure that the Import/Export server menu option is visible.
| `Issue #7648 <https://redmine.postgresql.org/issues/7648>`_ - Fixed API test case for change password in the server mode.
| `Issue #7663 <https://redmine.postgresql.org/issues/7663>`_ - Fixed ModuleNotFoundError when running setup.py to load/dump servers.

View File

@ -13,6 +13,13 @@ and settings database."""
import argparse
import os
import sys
# We need to include the root directory in sys.path to ensure that we can
# find everything we need when running in the standalone runtime.
root = os.path.dirname(os.path.realpath(__file__))
if sys.path[0] != root:
sys.path.insert(0, root)
import builtins
import config
@ -22,12 +29,6 @@ if 'SERVER_MODE' in globals():
else:
builtins.SERVER_MODE = None
# We need to include the root directory in sys.path to ensure that we can
# find everything we need when running in the standalone runtime.
root = os.path.dirname(os.path.realpath(__file__))
if sys.path[0] != root:
sys.path.insert(0, root)
from pgadmin.model import db, Version, SCHEMA_VERSION as CURRENT_SCHEMA_VERSION
from pgadmin import create_app
from pgadmin.utils import clear_database_servers, dump_database_servers,\