diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 0178c2d078a..6b478a3af9b 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -48,7 +48,6 @@ import time import types -from xml import dom, xpath import string import netsvc import re @@ -58,6 +57,14 @@ import pickle import fields import tools +import sys +try: + from xml import dom, xpath +except ImportError: + sys.stderr.write("ERROR: Import xpath module\n") + sys.stderr.write("ERROR: Try to install the old python-xml package\n") + sys.exit(2) + from tools.config import config regex_order = re.compile('^([a-zA-Z0-9_]+( desc)?( asc)?,?)+$', re.I) diff --git a/bin/tools/convert.py b/bin/tools/convert.py index 427467b909d..12b73f63a9a 100644 --- a/bin/tools/convert.py +++ b/bin/tools/convert.py @@ -41,7 +41,13 @@ import netsvc from config import config import logging -from lxml import etree +import sys +try: + from lxml import etree +except: + sys.stderr.write("ERROR: pythonic binding for the libxml2 and libxslt libraries is missing\n") + sys.stderr.write("ERROR: Try to install python-lxml package\n") + sys.exit(2) import pickle