Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #1796 -- implemented more robust normalisation for module filen…

…ames

before comparing them. Ivan Saglaev found a case where r3202 did not work
properly.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3206 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit db366b4a78f3f42ea19232e4c3b27f19e3ebe0c0 1 parent 25ffce4
Malcolm Tredinnick authored June 26, 2006

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  django/db/models/loading.py
4  django/db/models/loading.py
@@ -97,8 +97,8 @@ def register_models(app_label, *models):
97 97
             # The same model may be imported via different paths (e.g.
98 98
             # appname.models and project.appname.models). We use the source
99 99
             # filename as a means to detect identity.
100  
-            fname1 = os.path.normpath(sys.modules[model.__module__].__file__)
101  
-            fname2 = os.path.normpath(sys.modules[model_dict[model_name].__module__].__file__)
  100
+            fname1 = os.path.abspath(sys.modules[model.__module__].__file__)
  101
+            fname2 = os.path.abspath(sys.modules[model_dict[model_name].__module__].__file__)
102 102
             # Since the filename extension could be .py the first time and .pyc
103 103
             # or .pyo the second time, ignore the extension when comparing.
104 104
             if os.path.splitext(fname1)[0] == os.path.splitext(fname2)[0]:

0 notes on commit db366b4

Please sign in to comment.
Something went wrong with that request. Please try again.