~ubuntu-branches/ubuntu/trusty/pyrex/trusty-proposed

« back to all changes in this revision

Viewing changes to Pyrex/Utils.py

  • Committer: Bazaar Package Importer
  • Author(s): Paul Brossier
  • Date: 2006-06-14 18:21:15 UTC
  • mto: (2.1.5 edgy) (4.1.1 lenny) (1.1.7 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060614182115-54t2s7w2azy5oyof
Tags: upstream-0.9.4.1
ImportĀ upstreamĀ versionĀ 0.9.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
def replace_suffix(path, newsuf):
9
9
    base, _ = os.path.splitext(path)
10
10
    return base + newsuf
11
 
    
12
 
def default_open_new_file(path):
13
 
    return open(path, "w")
14
11
 
15
 
if sys.platform == "mac":
16
 
    from Pyrex.Mac.MacUtils import open_new_file
17
 
else:
18
 
    open_new_file = default_open_new_file
 
12
def open_new_file(path):
 
13
    #  Open and truncate existing file to
 
14
    #  preserve metadata on the Mac.
 
15
    return open(path, "w+")
19
16