Skip to content

Commit

Permalink
Python 3 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
prologic committed Aug 31, 2015
1 parent d512006 commit 67b08a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion setup.py
Expand Up @@ -7,12 +7,19 @@
from setuptools import setup, find_packages


def read_file(filename):
try:
return open(filename, "r").read()
except IOError:
return ""


setup(
name="circuits",
description="Asynchronous Component based Event Application Framework",
long_description=open("README.rst").read().replace(
".. include:: examples/index.rst",
open("examples/index.rst", "r").read()
read_file("examples/index.rst")
),
author="James Mills",
author_email="prologic@shortcircuit.net.au",
Expand Down
6 changes: 3 additions & 3 deletions tests/protocols/test_irc.py
Expand Up @@ -5,7 +5,7 @@
from pytest import fixture


from circuits.six import u
from circuits.six import b, u

from circuits import handler, Event, Component

Expand Down Expand Up @@ -72,13 +72,13 @@ def test_joinprefix():


def test_parsemsg():
s = ":foo!bar@localhost NICK foobar"
s = b(":foo!bar@localhost NICK foobar")
source, command, args = parsemsg(s)
assert source == (u("foo"), u("bar"), u("localhost"))
assert command == "NICK"
assert args == [u("foobar")]

s = ""
s = b("")
source, command, args = parsemsg(s)
assert source == (None, None, None)
assert command is None
Expand Down

0 comments on commit 67b08a3

Please sign in to comment.