diff --git a/pg_view/models/collector_partition.py b/pg_view/models/collector_partition.py index 97d209e..9922e66 100644 --- a/pg_view/models/collector_partition.py +++ b/pg_view/models/collector_partition.py @@ -1,14 +1,18 @@ +import os import time from multiprocessing import Process -import os import psutil +import sys from pg_view.consts import RD, TICK_LENGTH, SECTOR_SIZE from pg_view.formatters import StatusFormatter, FnFormatter from pg_view.models.collector_base import BaseStatCollector, logger from pg_view.models.displayers import COLALIGN +if sys.hexversion >= 0x03000000: + long = int + class PartitionStatCollector(BaseStatCollector): """Collect statistics about PostgreSQL partitions """ diff --git a/setup.py b/setup.py index 043dece..c011aa5 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ def read_module(path): data = {} with open(path, 'r') as fd: - exec (fd.read(), data) + exec(fd.read(), data) return data diff --git a/tests/common.py b/tests/common.py index 1bac869..9710f76 100644 --- a/tests/common.py +++ b/tests/common.py @@ -1,4 +1,7 @@ -from StringIO import StringIO +try: + from io import StringIO +except ImportError: + from StringIO import StringIO import os