Since the 1.5 update relative imports appear to be partly broken. For instance, with a folder testpkg containing the files __init__.py, foomod.py, barmod.py and barkmod.py, the following code for __init__.py will not work:
import foomod # ImportError: No module named foomod
from . import barmod # ValueError: Attempted relative import in non-package
from .barkmod import dog # ValueError: Attempted relative import in non-package
From what I've read in various places on the internet, any directory with a __init__.py file is considered a package, meaning that the above code should be valid. Many well-known Python libraries (e. g. setuptools) also use this syntax.
Interestingly enough this only happens when one of the package files is executed directly. When running import testpkg from the interpreter, thus executing __init__.py, there are no exceptions and all imports are handled correctly.