adding license + some filename cleanup
diff --git a/elftools/common/utils.py b/elftools/common/utils.py
index 7aa1cd9..e0a4cfe 100644
--- a/elftools/common/utils.py
+++ b/elftools/common/utils.py
@@ -6,6 +6,7 @@
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
+from contextlib import contextmanager
from .exceptions import ELFParseError, ELFError, DWARFError
from ..construct import ConstructError
@@ -71,13 +72,6 @@
_assert_with_exception(cond, msg, DWARFError)
-def _assert_with_exception(cond, msg, exception_type):
- if not cond:
- raise exception_type(msg)
-
-
-from contextlib import contextmanager
-
@contextmanager
def preserve_stream_pos(stream):
""" Usage:
@@ -91,3 +85,10 @@
yield
stream.seek(saved_pos)
+
+#------------------------- PRIVATE -------------------------
+
+def _assert_with_exception(cond, msg, exception_type):
+ if not cond:
+ raise exception_type(msg)
+