From 3b2d0d96091a6502f56a10c51ea6fdc7a359128d Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx <zooko@zooko.com> Date: Sat, 30 Oct 2010 01:10:35 -0700 Subject: [PATCH] setup: run require_auto_deps() before attempting to import any deps in __init__.py For one thing, this makes missing-dependency failures into DistributionNotFound errors instead of ImportErrors, which might be more useful to the user. For another thing, if someone is using distributions that were installed with --multi-version, then they might be not importable until after require_auto_deps() has been run. (The docs claim that this would be the case, but we don't have an example of this happening at this time.) --- src/allmydata/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/allmydata/__init__.py b/src/allmydata/__init__.py index efa3e7fb..3a5b2aaa 100644 --- a/src/allmydata/__init__.py +++ b/src/allmydata/__init__.py @@ -4,6 +4,9 @@ Decentralized storage grid. community web site: U{http://tahoe-lafs.org/} """ +from allmydata import _auto_deps +_auto_deps.require_auto_deps() + # This is just to suppress DeprecationWarnings from nevow and twisted. # See http://allmydata.org/trac/tahoe/ticket/859 and # http://divmod.org/trac/ticket/2994 . @@ -63,9 +66,6 @@ except ImportError: # http://allmydata.org/trac/tahoe/wiki/Versioning __full_version__ = __appname__ + '/' + str(__version__) -from allmydata import _auto_deps -_auto_deps.require_auto_deps() - import os, platform, re, subprocess, sys _distributor_id_cmdline_re = re.compile("(?:Distributor ID:)\s*(.*)", re.I) _release_cmdline_re = re.compile("(?:Release:)\s*(.*)", re.I) -- 2.45.2