Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Python 2.6 support #75

Merged
merged 2 commits into from
Mar 15, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blockfinder
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ class DownloaderParser:
entry = False
num_type = ""
for line in lir_file:
line = line.decode('utf-8', errors='ignore').replace("\n", "")
line = line.decode('utf-8', 'ignore').replace("\n", "")
if line == "":
entry = False
start_num, end_num, country_code, num_type = 0, 0, "", ""
Expand Down
8 changes: 6 additions & 2 deletions blockfindertest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import unittest
import os
import shutil
import sys
import tempfile

import blockfinder
Expand Down Expand Up @@ -84,8 +85,11 @@ def test_ipv6_bf(self):


if __name__ == '__main__':
failures = 0
for test_class in [CheckReverseLookup, CheckBlockFinder]:
test_suite = unittest.makeSuite(test_class)
test_runner = unittest.TextTestRunner(verbosity=2)
test_runner.run(test_suite)

results = test_runner.run(test_suite)
failures += len(results.errors)
failures += len(results.failures)
sys.exit(failures)