Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Revive Py2
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Jan 31, 2016
1 parent 8d899c8 commit 7244a08
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bin/synoptic
@@ -1,5 +1,6 @@
#! /usr/bin/env python2.5
from __future__ import absolute_import, print_function
import six


def get_data_path():
Expand Down Expand Up @@ -88,7 +89,7 @@ def main():
from ipaddress import ip_network
for net_str in args.allow_ip.split(","):
if net_str:
allowed_networks.append(ip_network(net_str))
allowed_networks.append(ip_network(six.text_type(net_str)))

from synoptic import Application
real_app = app = Application(allowed_networks=allowed_networks)
Expand Down
8 changes: 7 additions & 1 deletion setup.py
Expand Up @@ -4,6 +4,12 @@


def main():
import sys

extra_requires = []
if sys.version_info < (3,):
extra_requires += ["ipaddress"]

from setuptools import setup, find_packages

setup(name="synoptic",
Expand Down Expand Up @@ -40,7 +46,7 @@ def main():
],
zip_safe=False,

install_requires=[
install_requires=extra_requires + [
"Paste>=2",
"SQLAlchemy>=0.8",
"sqlalchemy-migrate>=0.7.2.24",
Expand Down
2 changes: 1 addition & 1 deletion synoptic/__init__.py
Expand Up @@ -293,7 +293,7 @@ def __call__(self, environ, start_response):
"but allowed_networks was specified")

from ipaddress import ip_address
remote_addr = ip_address(remote_addr_str)
remote_addr = ip_address(six.text_type(remote_addr_str))

allowed = False

Expand Down

0 comments on commit 7244a08

Please sign in to comment.