Replace some type checks with six type checks

Signed-off-by: Adrian Tschira <nota@notafile.com>
This commit is contained in:
Adrian Tschira 2018-04-07 00:37:36 +02:00
parent 135fc5b9cd
commit e54c202b81
5 changed files with 18 additions and 8 deletions

View file

@ -19,6 +19,8 @@ import os
import yaml
from textwrap import dedent
from six import integer_types
class ConfigError(Exception):
pass
@ -49,7 +51,7 @@ Missing mandatory `server_name` config option.
class Config(object):
@staticmethod
def parse_size(value):
if isinstance(value, int) or isinstance(value, long):
if isinstance(value, integer_types):
return value
sizes = {"K": 1024, "M": 1024 * 1024}
size = 1
@ -61,7 +63,7 @@ class Config(object):
@staticmethod
def parse_duration(value):
if isinstance(value, int) or isinstance(value, long):
if isinstance(value, integer_types):
return value
second = 1000
minute = 60 * second