Skip to content

Commit

Permalink
Fixed #23442 -- Added django.__version__ per PEP 396.
Browse files Browse the repository at this point in the history
Thanks abhillman for the suggestion and Claude Paroz for review.
  • Loading branch information
timgraham committed Sep 9, 2014
1 parent c53f245 commit d26199c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions django/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@


def get_version(*args, **kwargs):
# Don't litter django/__init__.py with all the get_version stuff.
# Only import if it's actually called.
# Avoid circular import

This comment has been minimized.

Copy link
@spookylukey

spookylukey Nov 22, 2014

Member

Given that get_version is immediately called after being defined, it seems unlikely that this avoids a circular import. Surely the def get_version definition could be replaced by the import here?

This comment has been minimized.

Copy link
@timgraham

timgraham Nov 24, 2014

Author Member

fixed in 0b16c13, thanks.

from django.utils.version import get_version
return get_version(*args, **kwargs)


__version__ = get_version(VERSION)


def setup():
"""
Configure the settings (this happens as a side effect of accessing the
Expand Down

0 comments on commit d26199c

Please sign in to comment.