Skip to content

Commit b0bd334

Browse files
committed
Better handle older versions of SQLObject being installed
git-svn-id: http://svn.colorstudy.com/trunk/SQLObject@768 95a46c32-92d2-0310-94a5-8d71aeb3d4b3
1 parent a1da940 commit b0bd334

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

scripts/sqlobject-admin

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33
import os
44
try:
5-
import sqlobject
5+
import sqlobject.manager
66
except ImportError:
77
try:
88
here = __file__
@@ -17,6 +17,11 @@ except ImportError:
1717
print 'I cannot find the sqlobject module'
1818
print 'If SQLObject is installed, you may need to set $PYTHONPATH'
1919
sys.exit(3)
20+
# Now we have to get rid of possibly stale modules from that import
21+
# up there
22+
for name, value in sys.modules.items():
23+
if name.startswith('sqlobject'):
24+
del sys.modules[name]
2025

2126
from sqlobject.manager import command
2227
command.the_runner.run(sys.argv)

0 commit comments

Comments
 (0)