p4cmd 2.4.9__tar.gz → 2.4.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p4cmd
3
- Version: 2.4.9
3
+ Version: 2.4.10
4
4
  Summary: Simple P4 python module
5
5
  Home-page: https://github.com/nielsvaes/p4cmd
6
6
  Author: Niels Vaes
@@ -51,7 +51,6 @@ class P4Client(object):
51
51
  if self.server is None:
52
52
  raise p4errors.WorkSpaceError("Could not find P4PORT")
53
53
 
54
-
55
54
  @classmethod
56
55
  def from_env(cls, *args, **kwargs):
57
56
  """
@@ -116,23 +115,24 @@ class P4Client(object):
116
115
  if len(command) > MAX_CMD_LEN:
117
116
  # This shouldn't happen, but just in case the command prefix end up really long
118
117
  logging.warning(f"Command length: {format(len(command))} exceeds MAX_CMD_LEN {MAX_CMD_LEN} on command: {MAX_CMD_LEN}")
119
- pipe = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
120
- output = pipe.stdout
121
-
122
- try:
123
- while True:
124
- value_dict = marshal.load(output)
125
- dict_list.append(value_dict)
126
- except EOFError:
127
- pass
128
- except ValueError as error:
129
- output_dict = {
130
- "command": command,
131
- "code": "error",
132
- "error": str(error),
133
- "raw_output": subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
134
- }
135
- dict_list.append(output_dict)
118
+
119
+ with subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True) as pipe:
120
+ output = pipe.stdout
121
+ try:
122
+ while True:
123
+ value_dict = marshal.load(output)
124
+ dict_list.append(value_dict)
125
+ except EOFError:
126
+ pass
127
+ except ValueError as error:
128
+ output_dict = {
129
+ "command": command,
130
+ "code": "error",
131
+ "error": str(error),
132
+ "raw_output": subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
133
+ }
134
+ dict_list.append(output_dict)
135
+ pipe.kill()
136
136
 
137
137
  return dict_list
138
138
 
@@ -869,6 +869,7 @@ class P4Client(object):
869
869
 
870
870
  try:
871
871
  sock = socket.create_connection((host, port), timeout=2)
872
+ sock.close()
872
873
  return True
873
874
  except:
874
875
  return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p4cmd
3
- Version: 2.4.9
3
+ Version: 2.4.10
4
4
  Summary: Simple P4 python module
5
5
  Home-page: https://github.com/nielsvaes/p4cmd
6
6
  Author: Niels Vaes
@@ -7,7 +7,7 @@ data_files_to_include = ["*.png"]
7
7
 
8
8
  setuptools.setup(
9
9
  name="p4cmd",
10
- version="2.4.9",
10
+ version="2.4.10",
11
11
  author="Niels Vaes",
12
12
  license='MIT',
13
13
  author_email="nielsvaes@gmail.com",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes