From 297598b7decb4ab7367ef978b9425f926b631309 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Mon, 14 Jul 2008 16:27:45 -0600 Subject: [PATCH] No, really --- __init__.py | 6 ++++++ gapstr.py | 1 - ip.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 29a8234..93dce7b 100755 --- a/__init__.py +++ b/__init__.py @@ -200,6 +200,12 @@ def bin(i, bits=None): return BitVector(i, bits).bitstr() +def unhex(s): + """Decode a string as hex, stripping whitespace first""" + + return [ord(i) for i in s.replace(' ', '').decode('hex')] + + ## ## Codecs ## diff --git a/gapstr.py b/gapstr.py index 2552388..ff7fc95 100755 --- a/gapstr.py +++ b/gapstr.py @@ -17,7 +17,6 @@ class GapString: self.length = 0 self.drop = drop if init: - print init self.append(init) def __len__(self): diff --git a/ip.py b/ip.py index c6f3b81..6641a23 100755 --- a/ip.py +++ b/ip.py @@ -494,7 +494,7 @@ class Session: saddr = chunk.first.saddr try: - (first, data) = self.pending[saddr] + (first, data) = self.pending.pop(saddr) except KeyError: first = chunk.first data = gapstr.GapString()