Skip to content

Commit

Permalink
webcore: By friendlier to Python 2.6
Browse files Browse the repository at this point in the history
We use logger.getChild(), which is available starting in
Python 2.7, which is fair since that's POX's requirement.
We now fall back to a dumb way of doing it which works
in 2.6.
  • Loading branch information
MurphyMc committed Mar 21, 2013
1 parent b785a35 commit daa8149
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pox/web/webcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@
from StringIO import StringIO

log = core.getLogger()
weblog = log.getChild("server")
try:
weblog = log.getChild("server")
except:
# I'm tired of people running Python 2.6 having problems with this.
#TODO: Remove this someday.
weblog = core.getLogger("webcore.server")

def _setAttribs (parent, child):
attrs = ['command', 'request_version', 'close_connection',
Expand Down

0 comments on commit daa8149

Please sign in to comment.