Skip to content

Commit

Permalink
Python3 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rsiera committed Dec 5, 2016
1 parent 1afd06c commit e1c18dc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion pg_view/models/collector_partition.py
Original file line number Diff line number Diff line change
@@ -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 """
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
5 changes: 4 additions & 1 deletion tests/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from StringIO import StringIO
try:
from io import StringIO
except ImportError:
from StringIO import StringIO

import os

Expand Down
2 changes: 1 addition & 1 deletion tests/test_models_pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test__read_proc_should_return_data_when_process_ok(self, mocked_psutil_proce

'guest_time': 0.0,
'starttime': datetime.datetime.fromtimestamp(1480777289.0),
'delayacct_blkio_ticks': 0L,
'delayacct_blkio_ticks': 0,
'cmdline': 'backend'
}
self.assertEqual(expected_proc_stats, proc_stats)
Expand Down

0 comments on commit e1c18dc

Please sign in to comment.