def replace_version(N):
 global ORIGINAL_VERSION_LINE
 with open(u'xonsh/__init__.py', u'r') as f:
  raw = f.read()
 lines = raw.splitlines()
 msg_assert = u'__version__ must be the first line of the __init__.py'
 assert (u'__version__' in lines[0]), msg_assert
 ORIGINAL_VERSION_LINE = lines[0]
 lines[0] = (lines[0].rstrip(u" '") + u".dev{}'".format(N))
 upd = (u'\n'.join(lines) + u'\n')
 with open(u'xonsh/__init__.py', u'w') as f:
  f.write(upd)

def replace_version ( N ) : global ORIGINAL_VERSION_LINE with open ( u'xonsh/__init__.py' , u'r' ) as f : raw = f . read ( ) lines = raw . splitlines ( ) msg_assert = u'__version__ must be the first line of the __init__.py' assert ( u'__version__' in lines [ 0 ] ) , msg_assert ORIGINAL_VERSION_LINE = lines [ 0 ] lines [ 0 ] = ( lines [ 0 ] . rstrip ( u" '" ) + u".dev{}'" . format ( N ) ) upd = ( u'\n' . join ( lines ) + u'\n' ) with open ( u'xonsh/__init__.py' , u'w' ) as f : f . write ( upd )
replace version in __init__ .