python-modernize -f lib2to3.fixes.fix_numliterals
This commit is contained in:
parent
e071f793ee
commit
f6e5bd11f3
6 changed files with 10 additions and 10 deletions
|
|
@ -430,7 +430,7 @@ class BuildRoot(object):
|
|||
if workdir:
|
||||
outfile = os.path.join(workdir, mocklog)
|
||||
flags = os.O_CREAT | os.O_WRONLY | os.O_APPEND
|
||||
fd = os.open(outfile, flags, 0666)
|
||||
fd = os.open(outfile, flags, 0o666)
|
||||
os.dup2(fd, 1)
|
||||
os.dup2(fd, 2)
|
||||
if os.getuid() == 0 and hasattr(self.options,"mockuser"):
|
||||
|
|
@ -1347,7 +1347,7 @@ class BuildMavenTask(BaseBuildTask):
|
|||
st = os.lstat(filepath)
|
||||
mtime = time.localtime(st.st_mtime)
|
||||
info = zipfile.ZipInfo(filepath[roottrim:])
|
||||
info.external_attr |= 0120000 << 16L # symlink file type
|
||||
info.external_attr |= 0o120000 << 16 # symlink file type
|
||||
info.compress_type = zipfile.ZIP_STORED
|
||||
info.date_time = mtime[:6]
|
||||
zfo.writestr(info, content)
|
||||
|
|
|
|||
2
cli/koji
2
cli/koji
|
|
@ -1579,7 +1579,7 @@ def handle_restart_hosts(options, session, args):
|
|||
|
||||
def linked_upload(localfile, path, name=None):
|
||||
"""Link a file into the (locally writable) workdir, bypassing upload"""
|
||||
old_umask = os.umask(002)
|
||||
old_umask = os.umask(0o02)
|
||||
try:
|
||||
if name is None:
|
||||
name = os.path.basename(localfile)
|
||||
|
|
|
|||
|
|
@ -8814,7 +8814,7 @@ class RootExports(object):
|
|||
# but we allow .log files to be uploaded multiple times to support
|
||||
# realtime log-file viewing
|
||||
raise koji.GenericError("file already exists: %s" % fn)
|
||||
fd = os.open(fn, os.O_RDWR | os.O_CREAT, 0666)
|
||||
fd = os.open(fn, os.O_RDWR | os.O_CREAT, 0o666)
|
||||
# log_error("fd=%r" %fd)
|
||||
try:
|
||||
if offset == 0 or (offset == -1 and size == len(contents)):
|
||||
|
|
@ -12523,7 +12523,7 @@ def handle_upload(environ):
|
|||
size = 0
|
||||
chksum = sum_cls()
|
||||
inf = environ['wsgi.input']
|
||||
fd = os.open(fn, os.O_RDWR | os.O_CREAT, 0666)
|
||||
fd = os.open(fn, os.O_RDWR | os.O_CREAT, 0o666)
|
||||
try:
|
||||
try:
|
||||
fcntl.lockf(fd, fcntl.LOCK_EX|fcntl.LOCK_NB)
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ def log_output(session, path, args, outfile, uploadpath, cwd=None, logerror=0, a
|
|||
flags = os.O_CREAT | os.O_WRONLY
|
||||
if append:
|
||||
flags |= os.O_APPEND
|
||||
fd = os.open(outfile, flags, 0666)
|
||||
fd = os.open(outfile, flags, 0o666)
|
||||
os.dup2(fd, 1)
|
||||
if logerror:
|
||||
os.dup2(fd, 2)
|
||||
|
|
|
|||
|
|
@ -466,12 +466,12 @@ class adler32_constructor(object):
|
|||
|
||||
#mimicing the hashlib constructors
|
||||
def __init__(self, arg=''):
|
||||
self._value = adler32(arg) & 0xffffffffL
|
||||
self._value = adler32(arg) & 0xffffffff
|
||||
#the bitwise and works around a bug in some versions of python
|
||||
#see: https://bugs.python.org/issue1202
|
||||
|
||||
def update(self, arg):
|
||||
self._value = adler32(arg, self._value) & 0xffffffffL
|
||||
self._value = adler32(arg, self._value) & 0xffffffff
|
||||
|
||||
def digest(self):
|
||||
return self._value
|
||||
|
|
|
|||
|
|
@ -883,7 +883,7 @@ class BuildTracker(object):
|
|||
if options.link_imports:
|
||||
#bit of a hack, but faster than uploading
|
||||
dst = "%s/%s/%s" % (koji.pathinfo.work(), serverdir, fn)
|
||||
old_umask = os.umask(002)
|
||||
old_umask = os.umask(0o02)
|
||||
try:
|
||||
koji.ensuredir(os.path.dirname(dst))
|
||||
os.chown(os.path.dirname(dst), 48, 48) #XXX - hack
|
||||
|
|
@ -1303,7 +1303,7 @@ def main(args):
|
|||
if options.logfile:
|
||||
filename = options.logfile
|
||||
try:
|
||||
logfile = os.open(filename,os.O_CREAT|os.O_RDWR|os.O_APPEND, 0777)
|
||||
logfile = os.open(filename,os.O_CREAT|os.O_RDWR|os.O_APPEND, 0o777)
|
||||
except:
|
||||
logfile = None
|
||||
if logfile is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue