mirror of
https://github.com/django/django.git
synced 2024-12-23 17:46:27 +00:00
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
This commit is contained in:
parent
ff25059ffb
commit
7ca1a04633
@ -206,7 +206,11 @@ def copy_helper(style, app_or_project, name, directory, other_name=''):
|
|||||||
def _make_writeable(filename):
|
def _make_writeable(filename):
|
||||||
"Makes sure that the file is writeable. Useful if our source is read-only."
|
"Makes sure that the file is writeable. Useful if our source is read-only."
|
||||||
import stat
|
import stat
|
||||||
|
if sys.platform.startswith('java'):
|
||||||
|
# On Jython there is no os.access()
|
||||||
|
return
|
||||||
if not os.access(filename, os.W_OK):
|
if not os.access(filename, os.W_OK):
|
||||||
st = os.stat(filename)
|
st = os.stat(filename)
|
||||||
new_permissions = stat.S_IMODE(st.st_mode) | stat.S_IWUSR
|
new_permissions = stat.S_IMODE(st.st_mode) | stat.S_IWUSR
|
||||||
os.chmod(filename, new_permissions)
|
os.chmod(filename, new_permissions)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user