#2849 hub: replace with py3 exception
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji issue2848  into  master

file modified
+4 -11
@@ -27,7 +27,6 @@ 

  import base64

  import calendar

  import datetime

- import errno

  import fcntl

  import fnmatch

  import functools
@@ -10506,11 +10505,8 @@ 

          fn = get_upload_path(path, name, create=True, volume=volume)

          try:

              st = os.lstat(fn)

-         except OSError as e:

-             if e.errno == errno.ENOENT:

-                 pass

-             else:

-                 raise

+         except FileNotFoundError:

+             pass

          else:

              if not stat.S_ISREG(st.st_mode):

                  raise koji.GenericError("destination not a file: %s" % fn)
@@ -10576,11 +10572,8 @@ 

          data = {}

          try:

              fd = os.open(fn, os.O_RDONLY)

-         except OSError as e:

-             if e.errno == errno.ENOENT:

-                 return None

-             else:

-                 raise

+         except FileNotFoundError:

+             return None

          try:

              try:

                  fcntl.lockf(fd, fcntl.LOCK_SH | fcntl.LOCK_NB)

Metadata Update from @tkopecek:
- Pull-request tagged with: no_qe

2 years ago

rebased onto efb9d22b5c05ed6ccbfa080f7cbdc944951f095c

2 years ago

rebased onto 9e2b2c7e3625b226ebe299f6b7ba83b3d5ad86e3

2 years ago

rebased onto c723e28

2 years ago

Commit 88feb6b fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago
Metadata