Skip to content

Commit

Permalink
Support Python 3 (#2964)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmuesch authored Jan 18, 2019
1 parent be03437 commit ab99941
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
8 changes: 3 additions & 5 deletions tcp_check/datadog_checks/tcp_check/tcp_check.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)

# stdlib
import socket
import time

# project
from datadog_checks.checks import NetworkCheck, Status
from datadog_checks.base import ensure_unicode
from datadog_checks.base.checks import NetworkCheck, Status


class BadConfException(Exception):
Expand Down Expand Up @@ -106,7 +104,7 @@ def _check(self, instance):
return Status.UP, "UP"

def report_as_service_check(self, sc_name, status, instance, msg=None):
instance_name = self.normalize(instance['name'])
instance_name = ensure_unicode(self.normalize(instance['name']))
host = instance.get('host', None)
port = instance.get('port', None)
custom_tags = instance.get('tags', [])
Expand Down
2 changes: 1 addition & 1 deletion tcp_check/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def get_requirements(fpath):
return f.readlines()


CHECKS_BASE_REQ = 'datadog_checks_base'
CHECKS_BASE_REQ = 'datadog_checks_base>=4.2.0'

setup(
name='datadog-tcp_check',
Expand Down
4 changes: 1 addition & 3 deletions tcp_check/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
minversion = 2.0
basepython = py27
envlist =
unit
{py27,py36}-unit
flake8

[testenv]
usedevelop = true
platform = linux2|darwin|windows

[testenv:unit]
deps =
-e../datadog_checks_base[deps]
-rrequirements-dev.txt
Expand Down

0 comments on commit ab99941

Please sign in to comment.