summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-09-15 11:19:50 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-09-15 11:19:50 +0000
commit7ca1a04633a7516df3610ff97a83d8850219622d (patch)
tree0513a1cf56cb9a362bfc4370e3dfee50fb52dad0
parentff25059ffb751bb50e363ef53f79a1e4382705bc (diff)
Fixed #5443 -- Handle lack of os.access() and os.chmod() in Jython. Thanks, Leo Soto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6281 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/management/base.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/django/core/management/base.py b/django/core/management/base.py
index 83b0ed05cd..d883fe23dc 100644
--- a/django/core/management/base.py
+++ b/django/core/management/base.py
@@ -206,7 +206,11 @@ def copy_helper(style, app_or_project, name, directory, other_name=''):
def _make_writeable(filename):
"Makes sure that the file is writeable. Useful if our source is read-only."
import stat
+ if sys.platform.startswith('java'):
+ # On Jython there is no os.access()
+ return
if not os.access(filename, os.W_OK):
- st = os.stat(filename)
- new_permissions = stat.S_IMODE(st.st_mode) | stat.S_IWUSR
- os.chmod(filename, new_permissions)
+ st = os.stat(filename)
+ new_permissions = stat.S_IMODE(st.st_mode) | stat.S_IWUSR
+ os.chmod(filename, new_permissions)
+