diff --git a/mercurial/strutil.py b/mercurial/strutil.py
--- a/mercurial/strutil.py
+++ b/mercurial/strutil.py
@@ -5,6 +5,8 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
+from __future__ import absolute_import
+
 def findall(haystack, needle, start=0, end=None):
     if end is None:
         end = len(haystack)