change sys.path unconditionally to work around people who have the egg installed

This commit is contained in:
Mike Dirolf 2009-01-28 15:32:42 -05:00
parent eb5af47c57
commit dab986f3da
15 changed files with 29 additions and 88 deletions

View File

@ -13,16 +13,12 @@
# limitations under the License.
import random
import sys
import traceback
import datetime
import re
import types
try:
import pymongo
except ImportError:
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
from pymongo.binary import Binary
from pymongo.objectid import ObjectId

View File

@ -15,12 +15,8 @@
"""Tests for the Binary wrapper."""
import unittest
try:
import pymongo
except ImportError:
import sys
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
from pymongo import binary

View File

@ -21,10 +21,7 @@ import glob
import sys
import types
try:
import pymongo
except ImportError:
sys.path[0:0] = [""]
sys.path[0:0] = [""]
import qcheck
from pymongo.binary import Binary

View File

@ -14,12 +14,8 @@
"""Test the collection module."""
import unittest
try:
import pymongo
except ImportError:
import sys
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
import qcheck
from test_connection import get_connection

View File

@ -16,12 +16,8 @@
import unittest
import os
try:
import pymongo
except ImportError:
import sys
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
from pymongo.errors import ConnectionFailure, InvalidName
from pymongo.database import Database

View File

@ -16,12 +16,8 @@
import unittest
import types
import random
try:
import pymongo
except ImportError:
import sys
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
from pymongo.errors import InvalidOperation
from pymongo.cursor import Cursor

View File

@ -18,12 +18,8 @@ import unittest
import types
import random
import datetime
try:
import pymongo
except ImportError:
import sys
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
from pymongo.errors import InvalidName, InvalidOperation, CollectionInvalid, OperationFailure
from pymongo.son import SON

View File

@ -16,12 +16,8 @@
import unittest
import types
try:
import pymongo
except ImportError:
import sys
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
from pymongo.objectid import ObjectId
from pymongo.dbref import DBRef

View File

@ -17,12 +17,8 @@
import unittest
import datetime
try:
import pymongo
except ImportError:
import sys
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
import qcheck
from test_connection import get_connection

View File

@ -16,12 +16,8 @@
"""
import unittest
try:
import pymongo
except ImportError:
import sys
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
import gridfs
from test_connection import get_connection

View File

@ -18,12 +18,8 @@ import unittest
import random
import types
import os
try:
import pymongo
except ImportError:
import sys
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
from pymongo.objectid import ObjectId
from pymongo.dbref import DBRef

View File

@ -15,12 +15,8 @@
"""Tests for the objectid module."""
import unittest
try:
import pymongo
except ImportError:
import sys
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
from pymongo.objectid import ObjectId
from pymongo.errors import InvalidId

View File

@ -24,12 +24,8 @@ localhost:27017 and localhost:27018 by default.
import unittest
import logging
import os
try:
import pymongo
except ImportError:
import sys
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
from pymongo.errors import ConnectionFailure, ConfigurationError
from pymongo.connection import Connection

View File

@ -17,12 +17,8 @@
import unittest
import datetime
import re
try:
import pymongo
except ImportError:
import sys
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
from pymongo.objectid import ObjectId
from pymongo.dbref import DBRef

View File

@ -16,12 +16,8 @@
"""
import unittest
try:
import pymongo
except ImportError:
import sys
sys.path[0:0] = [""]
import sys
sys.path[0:0] = [""]
import qcheck
from pymongo.objectid import ObjectId